Module: Representable::Binding::Deprecatable

Included in:
Representable::Binding
Defined in:
lib/representable/binding.rb

Overview

Single entry points for rendering and parsing a property are #compile_fragment and #uncompile_fragment in Mapper.

Instance Method Summary collapse

Instance Method Details

#compile_fragment(options) ⇒ Object

Retrieve value and write fragment to the doc.



35
36
37
# File 'lib/representable/binding.rb', line 35

def compile_fragment(options)
  render_pipeline(nil, options).(nil, options)
end

#uncompile_fragment(options) ⇒ Object

Parse value from doc and update the model property.



40
41
42
# File 'lib/representable/binding.rb', line 40

def uncompile_fragment(options)
  parse_pipeline(options[:doc], options).(options[:doc], options)
end