Class: Tumblargh::Renderer::Blocks::Boolean
- Inherits:
-
Tumblargh::Renderer::Base
- Object
- Tumblargh::Renderer::Base
- Tumblargh::Renderer::Blocks::Boolean
- Defined in:
- lib/tumblargh/renderer/blocks.rb
Overview
Meta-block for Appearance booleans, like block:IfSomething
Direct Known Subclasses
Instance Attribute Summary collapse
-
#variable ⇒ Object
readonly
Returns the value of attribute variable.
Attributes inherited from Tumblargh::Renderer::Base
Instance Method Summary collapse
-
#initialize(node, context, options = {}, *args) ⇒ Boolean
constructor
A new instance of Boolean.
- #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, options = {}, *args) ⇒ Boolean
Returns a new instance of Boolean.
94 95 96 97 |
# File 'lib/tumblargh/renderer/blocks.rb', line 94 def initialize(node, context, = {}, *args) @variable = 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
#variable ⇒ Object (readonly)
Returns the value of attribute variable.
92 93 94 |
# File 'lib/tumblargh/renderer/blocks.rb', line 92 def variable @variable end |
Instance Method Details
#should_render? ⇒ Boolean
99 100 101 |
# File 'lib/tumblargh/renderer/blocks.rb', line 99 def should_render? context.boolean(variable.downcase) end |