Class: Bbcode::HandlerElement
- Inherits:
-
Object
- Object
- Bbcode::HandlerElement
- Defined in:
- lib/bbcode/handler_element.rb
Overview
Private data source for an Element updated by the Handler
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#childs ⇒ Object
Returns the value of attribute childs.
-
#element ⇒ Object
readonly
Returns the value of attribute element.
-
#end_source ⇒ Object
readonly
Returns the value of attribute end_source.
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
-
#start_source ⇒ Object
readonly
Returns the value of attribute start_source.
-
#tagname ⇒ Object
readonly
Returns the value of attribute tagname.
Instance Method Summary collapse
- #end_element(source) ⇒ Object
-
#initialize(handler, tagname, attributes, start_source) ⇒ HandlerElement
constructor
A new instance of HandlerElement.
- #source ⇒ Object
Constructor Details
#initialize(handler, tagname, attributes, start_source) ⇒ HandlerElement
Returns a new instance of HandlerElement.
9 10 11 12 13 14 15 16 17 |
# File 'lib/bbcode/handler_element.rb', line 9 def initialize( handler, tagname, attributes, start_source ) @handler = handler @tagname = tagname @attributes = attributes @start_source = start_source @end_source = nil @childs = [] @element = Element.new(self) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
7 8 9 |
# File 'lib/bbcode/handler_element.rb', line 7 def attributes @attributes end |
#childs ⇒ Object
Returns the value of attribute childs.
6 7 8 |
# File 'lib/bbcode/handler_element.rb', line 6 def childs @childs end |
#element ⇒ Object (readonly)
Returns the value of attribute element.
7 8 9 |
# File 'lib/bbcode/handler_element.rb', line 7 def element @element end |
#end_source ⇒ Object (readonly)
Returns the value of attribute end_source.
7 8 9 |
# File 'lib/bbcode/handler_element.rb', line 7 def end_source @end_source end |
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
7 8 9 |
# File 'lib/bbcode/handler_element.rb', line 7 def handler @handler end |
#start_source ⇒ Object (readonly)
Returns the value of attribute start_source.
7 8 9 |
# File 'lib/bbcode/handler_element.rb', line 7 def start_source @start_source end |
#tagname ⇒ Object (readonly)
Returns the value of attribute tagname.
7 8 9 |
# File 'lib/bbcode/handler_element.rb', line 7 def tagname @tagname end |
Instance Method Details
#end_element(source) ⇒ Object
19 20 21 |
# File 'lib/bbcode/handler_element.rb', line 19 def end_element( source ) @end_source = source end |
#source ⇒ Object
23 24 25 |
# File 'lib/bbcode/handler_element.rb', line 23 def source "#{@start_source}#{@element.content.source}#{@end_source}" end |