Module: Eco::Data::Locations::NodePlain::Serial

Included in:
Builder
Defined in:
lib/eco/data/locations/node_plain/serial.rb

Instance Attribute Summary collapse

Instance Attribute Details

#serializerProc

Returns the serializer to be used.

Returns:

  • (Proc)

    the serializer to be used.



6
7
8
9
10
11
12
# File 'lib/eco/data/locations/node_plain/serial.rb', line 6

def serializer
  @serializer ||= proc do |node|
    raise "Expecting NodePlain. Given: #{node.class}" unless node.is_a?(Eco::Data::Locations::NodePlain)
    keys = Eco::Data::Locations::NodePlain::ALL_ATTRS
    node.to_h(*keys)
  end
end