Class: ActionMarkdown::Content
- Inherits:
-
Object
- Object
- ActionMarkdown::Content
- Includes:
- Rendering, Serialization, ActiveModel::Conversion
- Defined in:
- lib/action_markdown/content.rb
Instance Method Summary collapse
-
#initialize(body) ⇒ Content
constructor
A new instance of Content.
- #to_html ⇒ Object
- #to_markdown ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(body) ⇒ Content
Returns a new instance of Content.
5 6 7 |
# File 'lib/action_markdown/content.rb', line 5 def initialize(body) @body = body end |
Instance Method Details
#to_html ⇒ Object
13 14 15 |
# File 'lib/action_markdown/content.rb', line 13 def to_html markdown_renderer.render(body) end |
#to_markdown ⇒ Object
9 10 11 |
# File 'lib/action_markdown/content.rb', line 9 def to_markdown body end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/action_markdown/content.rb', line 17 def to_s render partial: to_partial_path, layout: false, locals: { content: self } end |