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

#cached_representer, #getter, #name, #setter

Instance Method Summary collapse

Methods included from Binding::Collection

#skipable_empty_value?

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

#[], 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

#evaluate_option

Methods included from Binding::Deprecatable

#compile_fragment, #uncompile_fragment

Constructor Details

This class inherits a constructor from Representable::Binding

Instance Method Details

#node_for(fragments) ⇒ Object



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

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