Class: Representable::ParseStrategy::Sync

Inherits:
Object
  • Object
show all
Defined in:
lib/representable/parse_strategies.rb

Class Method Summary collapse

Class Method Details

.apply!(name, options) ⇒ Object


35
36
37
38
39
40
41
# File 'lib/representable/parse_strategies.rb', line 35

def self.apply!(name, options)
  options[:setter]       = lambda { |*| }
  options[:pass_options] = true
  options[:instance]     = options[:collection] ?
    lambda { |fragment, i, options| options.binding.get[i] } :
    lambda { |fragment, options|    options.binding.get }
end