Class: Sesame::Client
- Inherits:
-
Object
show all
- Includes:
- Api
- Defined in:
- lib/sesame/client.rb
Constant Summary
Constants included
from Api
Api::ENDPOINT_URL
Instance Method Summary
collapse
Methods included from Api
#auth_token, #call, #client, #control_sesame, #get, #get_sesame, #get_sesames, #parse_response, #post
Constructor Details
#initialize(auth_token:) ⇒ Client
Returns a new instance of Client.
5
6
7
|
# File 'lib/sesame/client.rb', line 5
def initialize(auth_token:)
auth_token(auth_token)
end
|
Instance Method Details
#inspect ⇒ Object
19
20
21
|
# File 'lib/sesame/client.rb', line 19
def inspect
%(#<#{self.class.name}:#{format('0x%<object_id>.14x', object_id: (object_id << 1))}>)
end
|
#sesame(device_id:) ⇒ Object
15
16
17
|
# File 'lib/sesame/client.rb', line 15
def sesame(device_id:)
Sesame.new('device_id' => device_id).auth_token(@auth_token).refresh!
end
|
#sesames ⇒ Object
9
10
11
12
13
|
# File 'lib/sesame/client.rb', line 9
def sesames
get_sesames.collect do |sesame_attrs|
Sesame.new(sesame_attrs).auth_token(@auth_token)
end
end
|