Class: Tumblargh::Renderer::Blocks::NumberedPost
- Inherits:
-
Tumblargh::Renderer::Base
- Object
- Tumblargh::Renderer::Base
- Tumblargh::Renderer::Blocks::NumberedPost
- Defined in:
- lib/tumblargh/renderer/blocks.rb
Instance Attribute Summary collapse
-
#num ⇒ Object
readonly
Returns the value of attribute num.
Attributes inherited from Tumblargh::Renderer::Base
Instance Method Summary collapse
-
#initialize(node, context, *args) ⇒ NumberedPost
constructor
A new instance of NumberedPost.
- #should_render? ⇒ Boolean
Methods inherited from Tumblargh::Renderer::Base
#context_post, contextual_tag, #escape_html, #escape_url, #method_missing, #render, #strip_html
Constructor Details
#initialize(node, context, *args) ⇒ NumberedPost
Returns a new instance of NumberedPost.
16 17 18 19 |
# File 'lib/tumblargh/renderer/blocks.rb', line 16 def initialize(node, context, *args) @num = args[0] super(node, context) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Tumblargh::Renderer::Base
Instance Attribute Details
#num ⇒ Object (readonly)
Returns the value of attribute num.
14 15 16 |
# File 'lib/tumblargh/renderer/blocks.rb', line 14 def num @num end |
Instance Method Details
#should_render? ⇒ Boolean
21 22 23 |
# File 'lib/tumblargh/renderer/blocks.rb', line 21 def should_render? num == context.posts.index(context_post) + 1 end |