qrcodeable 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +23 -3
- data/lib/qrcodeable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 628fd6a1f1b4e1fecdb2e62a84cb6e542bc7af35
|
4
|
+
data.tar.gz: b2ade24352a5010a6808dcc52a55213d09558552
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fce11a7d6c65004dde2276f2c8c8744cef46534c858bb7e2c3119886eda8ba6a29da6279b531ad8375c69ce84c08afbae94c0accce4263f95e6896fc7adea36c
|
7
|
+
data.tar.gz: c826c37b5b8ce027d956a1e53479ba479e5e2494aefaf75dc29c848f3aa16433f522993b5e1c38bc3e492b0a04142e236c9cb1622b6d4360c98e6f37b261a0ac
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -30,10 +30,16 @@ to your model. You will need to add column `key` in your model using migration.
|
|
30
30
|
|
31
31
|
Options :
|
32
32
|
|
33
|
-
- `identifier`. A QRCode value used to generate QRCOde. Default value is `:key
|
34
|
-
- `print_path`. Default direcory for this gem. Default value is `"qrcodes/download"
|
33
|
+
- `identifier`. A QRCode value used to generate QRCOde. Default value is `:key`.
|
34
|
+
- `print_path`. Default direcory for this gem. Default value is `"qrcodes/download"`.
|
35
35
|
- `expire_mode`. Set to `true` if you want QRCode have expired_date. Default value is `false`.
|
36
|
-
- `expire_column`. You will need to add column `:expired_date` using migration if you set `expire_mode` to `true`. Default value is `:expired_date
|
36
|
+
- `expire_column`. You will need to add column `:expired_date` using migration if you set `expire_mode` to `true`. Default value is `:expired_date`.
|
37
|
+
|
38
|
+
Available methods :
|
39
|
+
|
40
|
+
- `print_qrcode` print qrcode, return `print_path`. You can add to callback or event send_file from controller.
|
41
|
+
- `qrcode_path` show qrcode_path, return `print_path`.
|
42
|
+
- `qrcode_expired?` check whether it is expired or not, return boolean.
|
37
43
|
|
38
44
|
## Examples
|
39
45
|
|
@@ -89,7 +95,21 @@ qrcodeable expired_mode: true, expire_column: :due_date
|
|
89
95
|
- can expiring
|
90
96
|
- expire_colum `:due_date`
|
91
97
|
|
98
|
+
### Example 6
|
99
|
+
```ruby
|
100
|
+
class Product < ApplicationRecord
|
101
|
+
qrcodeable expired_mode: true
|
102
|
+
end
|
103
|
+
|
104
|
+
@product = Product.new(name: "Yellow Jacket", key: "1234567890", expired_date: (Time.now+5.days))
|
92
105
|
|
106
|
+
@product.print_qrcode
|
107
|
+
|
108
|
+
@product.qrcode_path
|
109
|
+
|
110
|
+
@product.qrcode_expired?
|
111
|
+
|
112
|
+
```
|
93
113
|
|
94
114
|
## TODO:
|
95
115
|
|
data/lib/qrcodeable/version.rb
CHANGED