Sha256: b6e83c954bfbfc051956c7a87a91e4eb1df7845c28cc69f70f7eb0a211044841

Contents?: true

Size: 483 Bytes

Versions: 2

Compression:

Stored size: 483 Bytes

Contents

module RestfulObjects
  class CollectionList
    extend Forwardable

    def initialize(domain_type)
      @domain_type = domain_type
      @collections = Hash.new
    end

    def add(name, type, options = {})
      options[:member_order] ||= count + 1
      @collections[name] = CollectionDescription.new(name, type, @domain_type, options)
    end

    def_delegators :@collections, :[], :each, :each_key, :each_value, :include?, :count, :empty?, :clear
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
restful_objects-0.0.2 lib/restful_objects/collection_list.rb
restful_objects-0.0.1 lib/restful_objects/collection_list.rb