Class: Cloudpress::Renderers::Post
- Inherits:
-
Object
- Object
- Cloudpress::Renderers::Post
- Defined in:
- lib/cloudpress/renderers/post.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#post ⇒ Object
readonly
Returns the value of attribute post.
Instance Method Summary collapse
-
#initialize(context, post, options = {}) ⇒ Post
constructor
A new instance of Post.
- #render(&block) ⇒ Object
- #tags? ⇒ Boolean
Constructor Details
#initialize(context, post, options = {}) ⇒ Post
Returns a new instance of Post.
8 9 10 11 12 |
# File 'lib/cloudpress/renderers/post.rb', line 8 def initialize(context, post, ={}) @context = context @post = post @options = .reverse_merge end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
6 7 8 |
# File 'lib/cloudpress/renderers/post.rb', line 6 def content @content end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/cloudpress/renderers/post.rb', line 5 def @options end |
#post ⇒ Object (readonly)
Returns the value of attribute post.
5 6 7 |
# File 'lib/cloudpress/renderers/post.rb', line 5 def post @post end |
Instance Method Details
#render(&block) ⇒ Object
14 15 16 17 18 |
# File 'lib/cloudpress/renderers/post.rb', line 14 def render(&block) @context.render layout: template, locals: {renderer: self} do content end.html_safe end |
#tags? ⇒ Boolean
20 21 22 |
# File 'lib/cloudpress/renderers/post.rb', line 20 def [:tags] end |