Class: Thingdeck::Wrapper
- Inherits:
-
Object
- Object
- Thingdeck::Wrapper
- Defined in:
- lib/thingdeck/wrapper.rb
Instance Method Summary collapse
- #authorized? ⇒ Boolean
-
#initialize(app_id, secret) ⇒ Wrapper
constructor
A new instance of Wrapper.
- #perform_request(need_auth = true) ⇒ Object
- #property ⇒ Object
- #thing ⇒ Object
Constructor Details
#initialize(app_id, secret) ⇒ Wrapper
Returns a new instance of Wrapper.
3 4 5 |
# File 'lib/thingdeck/wrapper.rb', line 3 def initialize(app_id, secret) @token = authenticate(app_id, secret) end |
Instance Method Details
#authorized? ⇒ Boolean
7 8 9 |
# File 'lib/thingdeck/wrapper.rb', line 7 def !!@token end |
#perform_request(need_auth = true) ⇒ Object
19 20 21 22 23 |
# File 'lib/thingdeck/wrapper.rb', line 19 def perform_request(need_auth = true) raise 'Not Authorized' if need_auth and not response = yield(connection) parse_body(response) end |