Class: MachineShop::Device

Inherits:
APIResource show all
Includes:
APIOperations::Create, APIOperations::Delete, APIOperations::List
Defined in:
lib/machineshop/device.rb

Instance Attribute Summary

Attributes inherited from MachineShopObject

#auth_token

Instance Method Summary collapse

Methods included from APIOperations::Delete

#delete

Methods included from APIOperations::Create

included

Methods included from APIOperations::List

included

Methods inherited from APIResource

class_name, #refresh, retrieve, url, #url

Methods inherited from MachineShopObject

#[], #[]=, #as_json, construct_from, #each, #initialize, #inspect, #keys, #refresh_from, #to_hash, #to_json, #to_s, #values

Constructor Details

This class inherits a constructor from MachineShop::MachineShopObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MachineShop::MachineShopObject

Instance Method Details

#create_instance(params) ⇒ Object



12
13
14
15
# File 'lib/machineshop/device.rb', line 12

def create_instance(params)
  params.merge!({:device_id => self.id})
  DeviceInstance.create(params, @auth_token)
end

#instances(params = {}) ⇒ Object



17
18
19
20
# File 'lib/machineshop/device.rb', line 17

def instances(params={})
  params.merge!({:device_id => self.id})
  DeviceInstance.all(params, @auth_token)
end

#payload_fields(params = nil) ⇒ Object

Specific API calls



8
9
10
# File 'lib/machineshop/device.rb', line 8

def payload_fields(params=nil)
  MachineShop.gem_get(payload_fields_url, @auth_token, params)
end