Method: Representable::ClassMethods::Declarations#collection

Defined in:
lib/representable.rb

#collection(name, options = {}) ⇒ Object

Declares a represented document node collection.

Examples:

collection :products
collection :products, :from => :item
collection :products, :class => Product


191
192
193
194
# File 'lib/representable.rb', line 191

def collection(name, options={})
  options[:collection] = true
  property(name, options)
end