Class: Obp::Access::Renderer::Elements::SectionTitle
- Inherits:
-
Object
- Object
- Obp::Access::Renderer::Elements::SectionTitle
- Defined in:
- lib/obp/access/elements/section_title.rb
Constant Summary collapse
- LABEL_PATTERN =
/\A(\d+(?:\.\d+)*)\s{2,}/
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(raw_text) ⇒ SectionTitle
constructor
A new instance of SectionTitle.
Constructor Details
#initialize(raw_text) ⇒ SectionTitle
Returns a new instance of SectionTitle.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/obp/access/elements/section_title.rb', line 12 def initialize(raw_text) match = raw_text.match(LABEL_PATTERN) if match @label = match[1] @text = raw_text[match[0].length..].strip else @label = nil @text = raw_text.strip end end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
10 11 12 |
# File 'lib/obp/access/elements/section_title.rb', line 10 def label @label end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
10 11 12 |
# File 'lib/obp/access/elements/section_title.rb', line 10 def text @text end |