Class: Facwparser::Element::ListItem

Inherits:
ElementBase show all
Defined in:
lib/facwparser/element.rb

Instance Attribute Summary collapse

Attributes inherited from ElementBase

#children, #source

Instance Method Summary collapse

Methods inherited from ElementBase

#==, #render_text

Constructor Details

#initialize(source, symbols, value) ⇒ ListItem

Returns a new instance of ListItem.



98
99
100
101
102
103
# File 'lib/facwparser/element.rb', line 98

def initialize(source, symbols, value)
  super(source)
  @symbols = symbols
  @level   = symbols.size
  @value = value
end

Instance Attribute Details

#levelObject (readonly)

Returns the value of attribute level.



97
98
99
# File 'lib/facwparser/element.rb', line 97

def level
  @level
end

#symbolsObject (readonly)

Returns the value of attribute symbols.



97
98
99
# File 'lib/facwparser/element.rb', line 97

def symbols
  @symbols
end

#valueObject (readonly)

Returns the value of attribute value.



97
98
99
# File 'lib/facwparser/element.rb', line 97

def value
  @value
end

Instance Method Details

#render_html(options) ⇒ Object



104
105
106
107
# File 'lib/facwparser/element.rb', line 104

def render_html(options)
  @children ||= Parser.parse_value value, options
  render_html_by_name_and_children('li', @children, options)
end