Module: Representable::Decorator::Coercion::ClassMethods

Defined in:
lib/representable/decorator/coercion.rb

Instance Method Summary collapse

Instance Method Details

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



30
31
32
33
34
35
36
37
38
# File 'lib/representable/decorator/coercion.rb', line 30

def property(name, options={})
  if options[:type]
    options[:decorator_scope] = true # call setter on decorator so coercion kicks in.
    create_writer(name)
    create_reader(name)
  end

  super # Representable::Coercion.
end