Module: GenesisClient::Devices
- Included in:
- Client
- Defined in:
- lib/genesis_client/devices.rb
Instance Method Summary collapse
-
#create_device_log(sku, message) ⇒ Hashie::Mash
Create a new Log for a Device.
-
#device(sku) ⇒ Hashie::Mash
Receive a single Device.
-
#devices(type = nil) ⇒ Array<Hashie::Mash>
(also: #list_devices)
Receive a list of all Devices.
-
#update_device(sku, data) ⇒ Hashie::Mash
Modify an existing Device.
Instance Method Details
#create_device_log(sku, message) ⇒ Hashie::Mash
Create a new Log for a Device.
39 40 41 42 |
# File 'lib/genesis_client/devices.rb', line 39 def create_device_log(sku, ) data = { message: } post("/devices/#{sku}/logs", data)['log'] end |
#device(sku) ⇒ Hashie::Mash
Receive a single Device.
21 22 23 |
# File 'lib/genesis_client/devices.rb', line 21 def device(sku) get("/devices/#{sku}")['device'] end |
#devices(type = nil) ⇒ Array<Hashie::Mash> Also known as: list_devices
Receive a list of all Devices.
9 10 11 |
# File 'lib/genesis_client/devices.rb', line 9 def devices(type = nil) (type.nil? ? get('/devices') : get("/devices?type=#{type}"))['devices'] end |
#update_device(sku, data) ⇒ Hashie::Mash
Modify an existing Device.
30 31 32 |
# File 'lib/genesis_client/devices.rb', line 30 def update_device(sku, data) put("/devices/#{sku}", data)['device'] end |