Class: Html2Bbcode::Html::Element
- Inherits:
-
Object
- Object
- Html2Bbcode::Html::Element
- Extended by:
- Forwardable, Attributes
- Defined in:
- lib/html/element.rb
Instance Method Summary collapse
- #font_size ⇒ Object
-
#initialize(element, options = {}) ⇒ Element
constructor
A new instance of Element.
- #process ⇒ Object
- #to_bbcode_element ⇒ Object
Methods included from Attributes
Constructor Details
#initialize(element, options = {}) ⇒ Element
Returns a new instance of Element.
9 10 11 12 |
# File 'lib/html/element.rb', line 9 def initialize element, = {} @element = element @options = end |
Instance Method Details
#font_size ⇒ Object
30 31 32 |
# File 'lib/html/element.rb', line 30 def font_size get_size.to_i if get_font_size end |
#process ⇒ Object
14 15 16 17 18 |
# File 'lib/html/element.rb', line 14 def process add_src_to_text if name.eql? 'img' children.map(&:to_bbcode_element).join end |
#to_bbcode_element ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/html/element.rb', line 20 def to_bbcode_element if name == 'br' "\n" elsif element? build_bbcode_element elsif text? text end end |