Class: Html2Bbcode

Inherits:
Object
  • Object
show all
Defined in:
lib/html/color.rb,
lib/html2bbcode.rb,
lib/html/element.rb,
lib/bbcode/element.rb,
lib/html/attributes.rb,
lib/bbcode/closing_tags.rb

Defined Under Namespace

Classes: Bbcode, Html

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input_html, options = {}) ⇒ Html2Bbcode

Returns a new instance of Html2Bbcode.



14
15
16
17
# File 'lib/html2bbcode.rb', line 14

def initialize input_html, options = {}
  @parsed_html = Nokogiri::HTML::Document.parse input_html
  @options = options
end

Instance Attribute Details

#parsed_htmlObject (readonly)

Returns the value of attribute parsed_html.



19
20
21
# File 'lib/html2bbcode.rb', line 19

def parsed_html
  @parsed_html
end

Instance Method Details

#convertObject



21
22
23
# File 'lib/html2bbcode.rb', line 21

def convert
  html_element.process
end