Module: Vident2::Internals::AttributeWriter Private

Defined in:
lib/vident2/internals/attribute_writer.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Pure: ‘Plan -> Hash=> String` of `data-*` fragments. Delegates per-kind combining (space-join, grouped-by-controller, one-per-key) to each value class’s ‘.to_data_hash`.

Class Method Summary collapse

Class Method Details

.call(plan) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
17
18
19
# File 'lib/vident2/internals/attribute_writer.rb', line 14

def call(plan)
  Registry::KINDS.each_with_object({}) do |kind, acc|
    fragment = kind.value_class.to_data_hash(plan.public_send(kind.name))
    acc.merge!(fragment)
  end
end