Class: RestfulObjects::CollectionList

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/restful_objects/collection_list.rb

Instance Method Summary collapse

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, options = {})
  options[:member_order] ||= count + 1
  @collections[name] = CollectionDescription.new(name, type, @domain_type, options)
end