class Representable::XML::Binding::Collection

Public Instance Methods

deserialize_from(nodes) click to toggle source
# File lib/representable/xml/binding.rb, line 89
def deserialize_from(nodes)
  content_nodes = nodes.collect do |item| # TODO: move this to Node?
    content_for(item)
  end

  content_nodes
end
serialize_for(value, parent) click to toggle source
Calls superclass method
# File lib/representable/xml/binding.rb, line 84
def serialize_for(value, parent)
  # return NodeSet so << works.
  set_for(parent, value.collect { |item| super(item, parent) })
end

Private Instance Methods

set_for(parent, nodes) click to toggle source
# File lib/representable/xml/binding.rb, line 98
def set_for(parent, nodes)
  Nokogiri::XML::NodeSet.new(parent.document, nodes)
end