Class: PageStructuredData::Anchors

Inherits:
Object
  • Object
show all
Defined in:
app/src/page_structured_data/anchors.rb

Overview

Basic page metadata for any page

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(anchors:) ⇒ Anchors

Returns a new instance of Anchors.



8
9
10
# File 'app/src/page_structured_data/anchors.rb', line 8

def initialize(anchors:)
  @anchors = anchors
end

Instance Attribute Details

#anchorsObject (readonly)

Returns the value of attribute anchors.



6
7
8
# File 'app/src/page_structured_data/anchors.rb', line 6

def anchors
  @anchors
end

Instance Method Details

#anchor_for(title) ⇒ Object



16
17
18
# File 'app/src/page_structured_data/anchors.rb', line 16

def anchor_for(title)
  "##{anchors[title]}"
end

#titlesObject



12
13
14
# File 'app/src/page_structured_data/anchors.rb', line 12

def titles
  anchors.keys
end