Class: Facwparser::Element::Heading
- Inherits:
-
ElementBase
- Object
- ElementBase
- Facwparser::Element::Heading
- Defined in:
- lib/facwparser/element.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from ElementBase
Instance Method Summary collapse
-
#initialize(source, level, value) ⇒ Heading
constructor
A new instance of Heading.
- #render_html(options) ⇒ Object
Methods inherited from ElementBase
Constructor Details
#initialize(source, level, value) ⇒ Heading
Returns a new instance of Heading.
66 67 68 69 70 |
# File 'lib/facwparser/element.rb', line 66 def initialize(source, level, value) super(source) @level = level @value = value end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
65 66 67 |
# File 'lib/facwparser/element.rb', line 65 def id @id end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
64 65 66 |
# File 'lib/facwparser/element.rb', line 64 def level @level end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
64 65 66 |
# File 'lib/facwparser/element.rb', line 64 def value @value end |
Instance Method Details
#render_html(options) ⇒ Object
71 72 73 74 75 76 77 78 79 |
# File 'lib/facwparser/element.rb', line 71 def render_html() @children = Parser.parse_value value, if @id render_html_by_name_and_children(["h#{level}", {'id' => @id}], @children, ) + "\n" else render_html_by_name_and_children("h#{level}", @children, ) + "\n" end end |