quick_response 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# QuickResponse
|
2
|
+
|
3
|
+
QuickResponse is a **QR Code Generator**. It doesn't rely on any image manipulation library. Instead it's thin wrapper around the **Google Chart API**.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
gem install quick_response
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
### Initialization
|
12
|
+
|
13
|
+
First you need to create a QuickResponse object. For example to create a simple textual QR code:
|
14
|
+
|
15
|
+
QuickResponse::Text.new("Hello World!")
|
16
|
+
|
17
|
+
…or for a url:
|
18
|
+
|
19
|
+
QuickResponse::Url.new("robinclart.com")
|
20
|
+
|
21
|
+
You can also specify a size option:
|
22
|
+
|
23
|
+
QuickResponse::Url.new("robinclart.com", :size => 512)
|
24
|
+
|
25
|
+
### Shorthand
|
26
|
+
|
27
|
+
You can also use one of the shorthand versions:
|
28
|
+
|
29
|
+
QuickResponse.new(:text, "Hello World!")
|
30
|
+
|
31
|
+
…or:
|
32
|
+
|
33
|
+
QuickResponse.text("Hello World!")
|
34
|
+
|
35
|
+
### Methods
|
36
|
+
|
37
|
+
Once you have your QR object you have two methods available:
|
38
|
+
|
39
|
+
* The first one is `image_url`. This method will return the image url as you can guess.
|
40
|
+
* The second one is `save`. This method takes one argument that must be a string representing the local path where to save the image.
|
41
|
+
|
42
|
+
Examples:
|
43
|
+
|
44
|
+
qr = QuickResponse.url("robinclart.com")
|
45
|
+
|
46
|
+
qr.image_url
|
47
|
+
=> "http://chart.apis.google.com/chart?cht=qr&chs=256x256&chl=http%3A%2F%2Frobinclart.com"
|
48
|
+
|
49
|
+
qr.save("/tmp/qr/robinclart_com.png")
|
50
|
+
|
51
|
+
### Types
|
52
|
+
|
53
|
+
Available types are:
|
54
|
+
|
55
|
+
* Text (Takes many arguments that will be joined by a space)
|
56
|
+
* Url (Takes an url as first argument)
|
57
|
+
* Email (The first argument is a mail address)
|
58
|
+
* Call (The first argument is a phone number)
|
59
|
+
* Sms (The first argument is a phone number, the second (optional) is the message)
|
60
|
+
* Geo (Takes two arguments `longitude` and `lattitude`)
|
61
|
+
* Maps (Take an address as first argument and return a link to Google Maps)
|
62
|
+
|
63
|
+
|
data/lib/quick_response/base.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 2
|
9
|
+
version: 0.2.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Robin Clart
|
@@ -46,6 +46,7 @@ extra_rdoc_files: []
|
|
46
46
|
files:
|
47
47
|
- .gitignore
|
48
48
|
- Gemfile
|
49
|
+
- README.md
|
49
50
|
- Rakefile
|
50
51
|
- lib/quick_response.rb
|
51
52
|
- lib/quick_response/base.rb
|