lib/evrythng/client/collections.rb in evrythng-0.0.5 vs lib/evrythng/client/collections.rb in evrythng-0.1.0
- old
+ new
@@ -2,37 +2,29 @@
class Client
# Defines methods related to collections
module Collections
# Returns a list of collections
#
- # @format :json, :xml
- # @authenticated true
- # @rate_limited true
# @param options [Hash] A customizable set of options.
- # @return [Hashie::Mash] The requested list of collections.
- # @see http://dev.evrythng.net/doc/get/collections
+ # @return [Array] The requested list of collections.
+ # @see http://dev.evrythng.com/collections
# @example Return the list of collections
# Evrythng.collections
def collections(options={})
- response = get('collections', options)
- format.to_s.downcase == 'xml' ? response['collections'] : response
+ get('collections', options)
end
# Creates a collection
#
- # @format :json, :xml
- # @authenticated true
- # @rate_limited false
# @param name [String] The name of collection.
# @param description [String] The description of collection.
# @param options [Hash] A customizable set of options.
- # @return [Hashie::Mash] The created collection.
- # @see http://dev.evrythng.net/doc/post/collections
+ # @return [Hash] The created collection.
+ # @see http://dev.evrythng.com/collections
# @example Create the authenticating user's collection
# Evrythng.collection_create("This is a new collection!", "Here comes the description.")
def collection_create(name, description=nil, options={})
- response = post('collections', options.merge(:collection => { :name => name, :description => description }))
- format.to_s.downcase == 'xml' ? response['collection'] : response
+ post('collections', options.merge(:name => name, :description => description))
end
end
end
end