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

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

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

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