Class: RedcarpetText
- Defined in:
- lib/acts_as_markup/exts/redcarpet.rb
Instance Attribute Summary collapse
-
#markdown_processor ⇒ Object
readonly
Returns the value of attribute markdown_processor.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text, options = {}) ⇒ RedcarpetText
constructor
A new instance of RedcarpetText.
- #to_html ⇒ Object
Methods inherited from String
Constructor Details
#initialize(text, options = {}) ⇒ RedcarpetText
Returns a new instance of RedcarpetText.
6 7 8 9 10 |
# File 'lib/acts_as_markup/exts/redcarpet.rb', line 6 def initialize(text, = {}) super(text) @text = text @markdown_processor = Redcarpet::Markdown.new(Redcarpet::Render::HTML, {:autolink => true}.merge()) end |
Instance Attribute Details
#markdown_processor ⇒ Object (readonly)
Returns the value of attribute markdown_processor.
4 5 6 |
# File 'lib/acts_as_markup/exts/redcarpet.rb', line 4 def markdown_processor @markdown_processor end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
3 4 5 |
# File 'lib/acts_as_markup/exts/redcarpet.rb', line 3 def text @text end |
Instance Method Details
#to_html ⇒ Object
12 13 14 |
# File 'lib/acts_as_markup/exts/redcarpet.rb', line 12 def to_html markdown_processor.render(text) end |