Class: WikitextString
- Defined in:
- lib/acts_as_markup/exts/wikitext.rb
Overview
This allows a us to create a wrapper object similar to those provided by the Markdown and Textile libraries. It stores the original and formated HTML text in instance variables.
Instance Attribute Summary collapse
-
#html ⇒ Object
readonly
Returns the value of attribute html.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(str, *options) ⇒ WikitextString
constructor
A new instance of WikitextString.
- #to_html ⇒ Object
Methods inherited from String
Constructor Details
#initialize(str, *options) ⇒ WikitextString
Returns a new instance of WikitextString.
11 12 13 14 15 |
# File 'lib/acts_as_markup/exts/wikitext.rb', line 11 def initialize(str, *) super(str) @text = str.to_s @html = Wikitext::Parser.new(*).parse(@text) end |
Instance Attribute Details
#html ⇒ Object (readonly)
Returns the value of attribute html.
9 10 11 |
# File 'lib/acts_as_markup/exts/wikitext.rb', line 9 def html @html end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
8 9 10 |
# File 'lib/acts_as_markup/exts/wikitext.rb', line 8 def text @text end |
Instance Method Details
#to_html ⇒ Object
17 18 19 |
# File 'lib/acts_as_markup/exts/wikitext.rb', line 17 def to_html @html end |