Module: Pacer::Transform::GatherSection

Includes:
Visitors::VisitsSection
Defined in:
lib/pacer/transform/gather_section.rb

Defined Under Namespace

Classes: GatherSectionPipe

Instance Attribute Summary collapse

Attributes included from Visitors::VisitsSection

#section, #section_route, #visitor_num

Instance Method Summary collapse

Instance Attribute Details

#build_wrapperObject

Returns the value of attribute build_wrapper.



19
20
21
# File 'lib/pacer/transform/gather_section.rb', line 19

def build_wrapper
  @build_wrapper
end

Instance Method Details

#to_hashObject



28
29
30
# File 'lib/pacer/transform/gather_section.rb', line 28

def to_hash
  Hash[*paths.pairs(-2, -1).flatten]
end

#to_id_hashObject



21
22
23
24
25
26
# File 'lib/pacer/transform/gather_section.rb', line 21

def to_id_hash
  id_pairs = paths.pairs(-2, -1).map(element_type: :array) do |(k, v)|
    [k.element_id, v.map { |e| e.element_id }]
  end
  Hash[*id_pairs.flatten]
end