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
3 4 5 |
# File 'lib/govspeak/structured_header_extractor.rb', line 3 def headers @headers end |
#id ⇒ Object
Returns the value of attribute id
3 4 5 |
# File 'lib/govspeak/structured_header_extractor.rb', line 3 def id @id end |
#level ⇒ Object
Returns the value of attribute level
3 4 5 |
# File 'lib/govspeak/structured_header_extractor.rb', line 3 def level @level end |
#text ⇒ Object
Returns the value of attribute text
3 4 5 |
# File 'lib/govspeak/structured_header_extractor.rb', line 3 def text @text end |
Instance Method Details
#to_h ⇒ Object
12 13 14 15 16 |
# File 'lib/govspeak/structured_header_extractor.rb', line 12 def to_h Hash[members.zip(values)].merge( headers: headers.map(&:to_h), ) end |
#top_level ⇒ Object
4 5 6 |
# File 'lib/govspeak/structured_header_extractor.rb', line 4 def top_level 2 end |
#top_level? ⇒ Boolean
8 9 10 |
# File 'lib/govspeak/structured_header_extractor.rb', line 8 def top_level? level == top_level end |