Class: PageStructuredData::Anchors
- Inherits:
-
Object
- Object
- PageStructuredData::Anchors
- Defined in:
- app/src/page_structured_data/anchors.rb
Overview
Basic page metadata for any page
Instance Attribute Summary collapse
-
#anchors ⇒ Object
readonly
Returns the value of attribute anchors.
Instance Method Summary collapse
- #anchor_for(title) ⇒ Object
-
#initialize(anchors:) ⇒ Anchors
constructor
A new instance of Anchors.
- #titles ⇒ Object
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
#anchors ⇒ Object (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 |
#titles ⇒ Object
12 13 14 |
# File 'app/src/page_structured_data/anchors.rb', line 12 def titles anchors.keys end |