Class: RestfulObjects::CollectionList
- Inherits:
-
Object
- Object
- RestfulObjects::CollectionList
- Extended by:
- Forwardable
- Defined in:
- lib/restful_objects/collection_list.rb
Instance Method Summary collapse
- #add(name, type, options = {}) ⇒ Object
-
#initialize(domain_type) ⇒ CollectionList
constructor
A new instance of CollectionList.
Constructor Details
#initialize(domain_type) ⇒ CollectionList
Returns a new instance of CollectionList.
5 6 7 8 |
# File 'lib/restful_objects/collection_list.rb', line 5 def initialize(domain_type) @domain_type = domain_type @collections = Hash.new end |
Instance Method Details
#add(name, type, options = {}) ⇒ Object
10 11 12 13 |
# File 'lib/restful_objects/collection_list.rb', line 10 def add(name, type, = {}) [:member_order] ||= count + 1 @collections[name] = CollectionDescription.new(name, type, @domain_type, ) end |