Class: Kreuzberg::Result::PageHierarchy

Inherits:
Struct
  • Object
show all
Defined in:
lib/kreuzberg/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#block_countInteger (readonly)

Returns Number of hierarchy blocks.

Returns:

  • (Integer)

    Number of hierarchy blocks



132
133
134
135
136
# File 'lib/kreuzberg/result.rb', line 132

PageHierarchy = Struct.new(:block_count, :blocks) do
  def to_h
    { block_count: block_count, blocks: blocks.map(&:to_h) }
  end
end

#blocksArray<HierarchicalBlock> (readonly)

Returns Hierarchical blocks.

Returns:



132
133
134
135
136
# File 'lib/kreuzberg/result.rb', line 132

PageHierarchy = Struct.new(:block_count, :blocks) do
  def to_h
    { block_count: block_count, blocks: blocks.map(&:to_h) }
  end
end

Instance Method Details

#to_hObject



133
134
135
# File 'lib/kreuzberg/result.rb', line 133

def to_h
  { block_count: block_count, blocks: blocks.map(&:to_h) }
end