Module: Evrythng::Client::Thngs
- Included in:
- Evrythng::Client
- Defined in:
- lib/evrythng/client/thngs.rb
Overview
Defines methods related to thngs
Instance Method Summary collapse
-
#thng(id, options = {}) ⇒ Hash
Returns a single thng, specified by id.
-
#thng_create(name, description = nil, options = {}) ⇒ Hash
Creates a thng.
-
#thng_update(id, options = {}) ⇒ Hash
Updates a thng.
-
#thngs(options = {}) ⇒ Array
Returns a list of thngs.
Instance Method Details
#thng(id, options = {}) ⇒ Hash
Returns a single thng, specified by id
24 25 26 |
# File 'lib/evrythng/client/thngs.rb', line 24 def thng(id, ={}) get("thngs/#{id}", ) end |
#thng_create(name, description = nil, options = {}) ⇒ Hash
Creates a thng
37 38 39 |
# File 'lib/evrythng/client/thngs.rb', line 37 def thng_create(name, description=nil, ={}) post("thngs", .merge(:name => name, :description => description)) end |
#thng_update(id, options = {}) ⇒ Hash
Updates a thng
49 50 51 |
# File 'lib/evrythng/client/thngs.rb', line 49 def thng_update(id, ={}) put("thngs/#{id}", ) end |
#thngs(options = {}) ⇒ Array
Returns a list of thngs
12 13 14 |
# File 'lib/evrythng/client/thngs.rb', line 12 def thngs(={}) get('thngs', ) end |