Class: Tumblargh::Renderer::Blocks::Boolean

Inherits:
Tumblargh::Renderer::Base show all
Defined in:
lib/tumblargh/renderer/blocks.rb

Overview

Meta-block for Appearance booleans, like block:IfSomething

Direct Known Subclasses

InverseBoolean

Instance Attribute Summary collapse

Attributes inherited from Tumblargh::Renderer::Base

#context, #node, #options

Instance Method Summary collapse

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, options = {}, *args)
  @variable = args[0]
  super(node, context, options)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Tumblargh::Renderer::Base

Instance Attribute Details

#variableObject (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

Returns:



99
100
101
# File 'lib/tumblargh/renderer/blocks.rb', line 99

def should_render?
  context.boolean(variable.downcase)
end