class Eco::Data::Locations::NodePlain module Serial attr_writer :serializer # @return [Proc] the serializer to be used. 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::NODE_PLAIN_ATTRS node.to_h(*keys) end end end end