Class: PhonegapBuild::Client
- Inherits:
-
Object
- Object
- PhonegapBuild::Client
- Defined in:
- lib/phonegap_build.rb
Instance Method Summary collapse
- #action(res, name, more = nil) ⇒ Object
- #apps ⇒ Object
-
#initialize(username, password) ⇒ Client
constructor
A new instance of Client.
- #keys ⇒ Object
- #me ⇒ Object
- #parse(text) ⇒ Object
Constructor Details
Instance Method Details
#action(res, name, more = nil) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/phonegap_build.rb', line 32 def action(res, name, more = nil) available = { build: :post, unlock: :post } method = available[name.to_sym] puts res[name] if ENV['DEBUG'] if method res = res[name] res = res[more] if more puts "#{method.upcase} #{res}" if ENV['DEBUG'] res.send(method, data: {}) true else false end end |
#apps ⇒ Object
20 21 22 |
# File 'lib/phonegap_build.rb', line 20 def apps ResourceCollection.new(self, @client['apps'], false, 'apps') end |
#keys ⇒ Object
24 25 26 |
# File 'lib/phonegap_build.rb', line 24 def keys ResourceCollection.new(self, @client['keys'], false, 'keys') end |
#me ⇒ Object
16 17 18 |
# File 'lib/phonegap_build.rb', line 16 def me Resource.new(self, @client['me']) end |
#parse(text) ⇒ Object
28 29 30 |
# File 'lib/phonegap_build.rb', line 28 def parse(text) JSON.parse(text, object_class: OpenStruct, array_class: Array) end |