Class: Representable::YAML::Binding::Collection

Inherits:
Representable::YAML::Binding show all
Includes:
Binding::Collection
Defined in:
lib/representable/yaml/binding.rb

Instance Attribute Summary

Attributes inherited from Binding

#represented, #user_options

Instance Method Summary collapse

Methods inherited from Representable::YAML::Binding

build_for, #deserialize_method, #serialize_method, #write, #write_scalar

Methods inherited from Hash::Binding

build_for, #deserialize_method, #read, #serialize_method, #write

Methods inherited from Binding

#[], #array?, #as, build, #compile_fragment, #default_for, #evaluate_option, #get, #getter, #has_default?, #initialize, #name, #parse_filter, #read_fragment, #render_filter, #render_fragment, #representable?, #representer_module, #representer_module_for, #set, #setter, #skipable_empty_value?, #typed?, #uncompile_fragment, #write_fragment

Constructor Details

This class inherits a constructor from Representable::Binding

Instance Method Details

#node_for(fragments) ⇒ Object



39
40
41
42
43
44
# File 'lib/representable/yaml/binding.rb', line 39

def node_for(fragments)
  Psych::Nodes::Sequence.new.tap do |seq|
    seq.style = Psych::Nodes::Sequence::FLOW if self[:style] == :flow
    fragments.each { |frag| seq.children << write_scalar(frag) }
  end
end