Class: Representable::Function::Decorate

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

Instance Method Summary collapse

Instance Method Details

#call(object, options) ⇒ Object



44
45
46
47
48
49
50
51
52
# File 'lib/representable/deserializer.rb', line 44

def call(object, options)
  binding = options[:binding]

  return object unless object # object might be nil.

  mod = binding.evaluate_option(:extend, object, options)

  prepare_for(mod, object, binding)
end

#prepare_for(mod, object, binding) ⇒ Object



54
55
56
# File 'lib/representable/deserializer.rb', line 54

def prepare_for(mod, object, binding)
  mod.prepare(object)
end