lib/evrythng/client/thngs.rb in evrythng-0.1.0 vs lib/evrythng/client/thngs.rb in evrythng-0.1.1
- old
+ new
@@ -33,10 +33,22 @@
# @return [Hash] The created thng.
# @see http://dev.evrythng.com/thngs
# @example Create the authenticating user's thng
# Evrythng.thng_create("my.test.thng", "Here comes the description.")
def thng_create(name, description=nil, options={})
- post('thngs', options.merge(:name => name, :description => description))
+ post("thngs", options.merge(:name => name, :description => description))
+ end
+
+ # Updates a thng
+ #
+ # @param id [String] The id of thng.
+ # @param options [Hash] A customizable set of options.
+ # @return [Hash] The updated thng.
+ # @see http://dev.evrythng.com/thngs
+ # @example Update the authenticating user's thng with id 4f2133f39f5c550c2000016a
+ # Evrythng.thng_update('4f2133f39f5c550c2000016a', :name => 'my.test.thng.updated')
+ def thng_update(id, options={})
+ put("thngs/#{id}", options)
end
end
end
end