Module: Mongoo::Attributes::DescribeDsl

Included in:
DescribeDsl
Defined in:
lib/mongoo/attributes/describe_dsl.rb

Instance Method Summary collapse

Instance Method Details

#attribute(name, opts = {}) ⇒ Object

Raises:

  • (ArgumentError)


4
5
6
7
8
# File 'lib/mongoo/attributes/describe_dsl.rb', line 4

def attribute(name, opts={})
  raise ArgumentError.new("missing :type") unless opts[:type]
  @klass.attributes[name.to_s] = opts
  true
end