Class: Govspeak::StructuredHeader
- Inherits:
-
Struct
- Object
- Struct
- Govspeak::StructuredHeader
- Defined in:
- lib/govspeak/structured_header_extractor.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#id ⇒ Object
Returns the value of attribute id.
-
#level ⇒ Object
Returns the value of attribute level.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
Instance Attribute Details
#headers ⇒ Object
Returns the value of attribute headers
2 3 4 |
# File 'lib/govspeak/structured_header_extractor.rb', line 2 def headers @headers end |
#id ⇒ Object
Returns the value of attribute id
2 3 4 |
# File 'lib/govspeak/structured_header_extractor.rb', line 2 def id @id end |
#level ⇒ Object
Returns the value of attribute level
2 3 4 |
# File 'lib/govspeak/structured_header_extractor.rb', line 2 def level @level end |
#text ⇒ Object
Returns the value of attribute text
2 3 4 |
# File 'lib/govspeak/structured_header_extractor.rb', line 2 def text @text end |
Instance Method Details
#to_h ⇒ Object
11 12 13 14 15 |
# File 'lib/govspeak/structured_header_extractor.rb', line 11 def to_h Hash[members.zip(values)].merge( headers: headers.map(&:to_h), ) end |
#top_level ⇒ Object
3 4 5 |
# File 'lib/govspeak/structured_header_extractor.rb', line 3 def top_level 2 end |
#top_level? ⇒ Boolean
7 8 9 |
# File 'lib/govspeak/structured_header_extractor.rb', line 7 def top_level? level == top_level end |