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.
Files changed (5) hide show
  1. data/README.md +10 -2
  2. data/Rakefile +1 -1
  3. data/lib/passdock.rb +15 -0
  4. data/passdock.gemspec +1 -1
  5. 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 jash 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 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
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('passdock', '0.1.6') do |p|
5
+ Echoe.new('passdock', '0.1.7') do |p|
6
6
  p.description = "Talk with Passdock API"
7
7
  p.url = "http://github.com/Creapptor/passdock-ruby"
8
8
  p.author = "Creapptor S.A."
@@ -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"
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "passdock"
5
- s.version = "0.1.6"
5
+ s.version = "0.1.7"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Creapptor S.A."]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passdock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: