Class: Facwparser::Element::List
- Inherits:
-
ElementBase
- Object
- ElementBase
- Facwparser::Element::List
- Defined in:
- lib/facwparser/element.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from ElementBase
Instance Method Summary collapse
-
#initialize(type) ⇒ List
constructor
A new instance of List.
- #push(item) ⇒ Object
- #render_html(options) ⇒ Object
Methods inherited from ElementBase
Constructor Details
#initialize(type) ⇒ List
Returns a new instance of List.
83 84 85 86 |
# File 'lib/facwparser/element.rb', line 83 def initialize(type) super('') @type = type end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
82 83 84 |
# File 'lib/facwparser/element.rb', line 82 def type @type end |
Instance Method Details
#push(item) ⇒ Object
87 88 89 90 91 |
# File 'lib/facwparser/element.rb', line 87 def push(item) @children ||= [] @children.push(item) self end |
#render_html(options) ⇒ Object
92 93 94 |
# File 'lib/facwparser/element.rb', line 92 def render_html() (render_html_by_name_and_children(@type == '#' ? 'ol' : 'ul', @children, , "\n", "\n") + "\n").gsub("\n\n", "\n") end |