Class: Representable::Object::Binding
- Defined in:
- lib/representable/object/binding.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Collection
Instance Attribute Summary
Attributes inherited from Binding
#cached_representer, #getter, #name, #setter
Class Method Summary collapse
-
.build_for(definition) ⇒ Object
TODO: remove default arg.
Instance Method Summary collapse
- #deserialize_method ⇒ Object
- #read(hash, as) ⇒ Object
- #serialize_method ⇒ Object
- #write(hash, fragment, as) ⇒ Object
Methods inherited from Binding
#[], build, #default_for, #initialize, #skipable_empty_value?
Methods included from Binding::Factories
#collect_for, #default_parse_fragment_functions, #default_parse_init_functions, #default_post_functions, #default_render_fragment_functions, #default_render_init_functions, #parse_functions, #pipeline_for, #render_functions
Methods included from Binding::EvaluateOption
Methods included from Binding::Deprecatable
#compile_fragment, #uncompile_fragment
Constructor Details
This class inherits a constructor from Representable::Binding
Class Method Details
.build_for(definition) ⇒ Object
TODO: remove default arg.
6 7 8 9 10 |
# File 'lib/representable/object/binding.rb', line 6 def self.build_for(definition) # TODO: remove default arg. return Collection.new(definition) if definition.array? new(definition) end |
Instance Method Details
#deserialize_method ⇒ Object
24 25 26 |
# File 'lib/representable/object/binding.rb', line 24 def deserialize_method :from_object end |
#read(hash, as) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/representable/object/binding.rb', line 12 def read(hash, as) fragment = hash.send(as) # :getter? no, that's for parsing! return FragmentNotFound if fragment.nil? and typed? fragment end |
#serialize_method ⇒ Object
28 29 30 |
# File 'lib/representable/object/binding.rb', line 28 def serialize_method :to_object end |
#write(hash, fragment, as) ⇒ Object
20 21 22 |
# File 'lib/representable/object/binding.rb', line 20 def write(hash, fragment, as) true end |