Module: Evrythng::Client::Properties
- Included in:
- Evrythng::Client
- Defined in:
- lib/evrythng/client/properties.rb
Overview
Defines methods related to properties
Instance Method Summary collapse
-
#properties(thng_id, options = {}) ⇒ Array
Returns a list of properties for a given thng.
-
#property(thng_id, key, options = {}) ⇒ Hash
Returns a single property, specified by key.
-
#property_create(thng_id, key, value, options = {}) ⇒ Hash
Creates a property.
-
#property_update(thng_id, key, value, options = {}) ⇒ Hash
Updates a property.
Instance Method Details
#properties(thng_id, options = {}) ⇒ Array
Returns a list of properties for a given thng
13 14 15 |
# File 'lib/evrythng/client/properties.rb', line 13 def properties(thng_id, ={}) get("thngs/#{thng_id}/properties", ) end |
#property(thng_id, key, options = {}) ⇒ Hash
Returns a single property, specified by key
26 27 28 |
# File 'lib/evrythng/client/properties.rb', line 26 def property(thng_id, key, ={}) get("thngs/#{thng_id}/properties/#{key}", ) end |
#property_create(thng_id, key, value, options = {}) ⇒ Hash
Creates a property
40 41 42 |
# File 'lib/evrythng/client/properties.rb', line 40 def property_create(thng_id, key, value, ={}) post("thngs/#{thng_id}/properties", .merge(:key => key, :value => value)) end |
#property_update(thng_id, key, value, options = {}) ⇒ Hash
Updates a property
54 55 56 |
# File 'lib/evrythng/client/properties.rb', line 54 def property_update(thng_id, key, value, ={}) put("thngs/#{thng_id}/properties/#{key}", .merge(:value => value)) end |