Class: Seam::Clients::Locks
- Inherits:
-
BaseClient
- Object
- BaseClient
- Seam::Clients::Locks
- Defined in:
- lib/seam/clients/locks.rb
Instance Attribute Summary
Attributes inherited from BaseClient
Instance Method Summary collapse
- #get(device_or_id) ⇒ Object
- #list(body = {}) ⇒ Object
-
#lock_door(device_or_id) ⇒ Seam::ActionAttempt
Locks a door.
-
#unlock_door(device_or_id) ⇒ Seam::ActionAttempt
Unlocks a door.
Methods inherited from BaseClient
#initialize, #request_seam, #request_seam_object
Constructor Details
This class inherits a constructor from Seam::Clients::BaseClient
Instance Method Details
#get(device_or_id) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/seam/clients/locks.rb', line 48 def get(device_or_id) request_seam_object( :post, "/locks/get", Seam::Device, "lock", body: { device_id: device_id(device_or_id) } ) end |
#list(body = {}) ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'lib/seam/clients/locks.rb', line 38 def list(body = {}) request_seam_object( :post, "/locks/list", Seam::Device, "locks", body: body ) end |
#lock_door(device_or_id) ⇒ Seam::ActionAttempt
Locks a door
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/seam/clients/locks.rb', line 26 def lock_door(device_or_id) request_seam_object( :post, "/locks/lock_door", Seam::ActionAttempt, "action_attempt", body: { device_id: device_id(device_or_id) } ) end |
#unlock_door(device_or_id) ⇒ Seam::ActionAttempt
Unlocks a door
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/seam/clients/locks.rb', line 10 def unlock_door(device_or_id) request_seam_object( :post, "/locks/unlock_door", Seam::ActionAttempt, "action_attempt", body: { device_id: device_id(device_or_id) } ) end |