passdock 0.1.6 → 0.1.7
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 +10 -2
- data/Rakefile +1 -1
- data/lib/passdock.rb +15 -0
- data/passdock.gemspec +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -74,13 +74,21 @@ The second argument is the template id, the third one if you want debug informat
|
|
74
74
|
|
75
75
|
#### Update a Pass
|
76
76
|
|
77
|
-
The first argument is the a JSON
|
78
|
-
The second argument is the template id, the third one if you want debug informations and the last one exanded errors.
|
77
|
+
The first argument is the a JSON hash containing the Pass structure, more informations on [api.passdock.com/doc](https://api.passdock.com/doc).
|
78
|
+
The second argument is the template id, the third the pass id, the fourth one if you want debug informations and the last one exanded errors.
|
79
79
|
|
80
80
|
pp Passdock.update_pass('{"serial_number":"5678", "gate":"15"}', 94, 82, true, false)
|
81
81
|
|
82
|
+
#### Update a Template
|
83
|
+
|
84
|
+
The first argument is the a JSON hash containing the Template structure, more informations on [api.passdock.com/doc](https://api.passdock.com/doc).
|
85
|
+
The second argument is the template id, the third one if you want debug informations and the last one exanded errors.
|
86
|
+
|
87
|
+
pp Passdock.update_template('{"gate":"15"}', 94, true, false)
|
88
|
+
|
82
89
|
#### Download a Pass
|
83
90
|
|
91
|
+
|
84
92
|
The first parameter is the Pass ID, the second its template ID
|
85
93
|
|
86
94
|
pp Passdock.download_pass(82, 82)
|
data/Rakefile
CHANGED
data/lib/passdock.rb
CHANGED
@@ -62,6 +62,20 @@ module Passdock
|
|
62
62
|
self.post("#{@@api_base}/templates/#{family_id}/passes.json", options)
|
63
63
|
end
|
64
64
|
|
65
|
+
def self.update_template(template, family_id, debug, errors)
|
66
|
+
_debug = debug ? "true" : "false"
|
67
|
+
_errors = errors ? "true" : "false"
|
68
|
+
options = {
|
69
|
+
:body => {
|
70
|
+
:debug => _debug,
|
71
|
+
:errors => _errors,
|
72
|
+
:api_token => @@api_key,
|
73
|
+
:family => template
|
74
|
+
}
|
75
|
+
}
|
76
|
+
self.put("#{@@api_base}/templates/#{family_id}.json", options)
|
77
|
+
end
|
78
|
+
|
65
79
|
def self.update_pass(pass, pass_id, family_id, debug, errors)
|
66
80
|
_debug = debug ? "true" : "false"
|
67
81
|
_errors = errors ? "true" : "false"
|
@@ -75,6 +89,7 @@ module Passdock
|
|
75
89
|
}
|
76
90
|
self.put("#{@@api_base}/templates/#{family_id}/passes/#{pass_id}.json", options)
|
77
91
|
end
|
92
|
+
|
78
93
|
|
79
94
|
def self.destroy_pass(pass_id, family_id, errors)
|
80
95
|
_errors = errors ? "true" : "false"
|
data/passdock.gemspec
CHANGED