Module: Representable::DSLAdditions

Defined in:
lib/representable.rb

Overview

Internal module for DSL sugar that should not go into the core library.

Instance Method Summary collapse

Instance Method Details

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



155
156
157
158
159
160
161
162
163
# File 'lib/representable.rb', line 155

def property(name, options={}, &block)
  return super unless block_given?

  inline = inline_representer(representer_engine, name, options, &block)
  inline.module_eval { include options[:extend] } if options[:extend]

  options[:extend] = inline
  super
end