Class: Serbea::ComponentRenderer
- Inherits:
-
Object
- Object
- Serbea::ComponentRenderer
- Includes:
- Helpers
- Defined in:
- lib/serbea/component_renderer.rb
Instance Method Summary collapse
-
#initialize(variables = {}) ⇒ ComponentRenderer
constructor
A new instance of ComponentRenderer.
- #method_missing(key) ⇒ Object
- #respond_to_missing?(key, include_private = false) ⇒ Boolean
Methods included from Helpers
#capture, #h, #helper, #pipeline
Constructor Details
#initialize(variables = {}) ⇒ ComponentRenderer
Returns a new instance of ComponentRenderer.
5 6 7 |
# File 'lib/serbea/component_renderer.rb', line 5 def initialize(variables = {}) @variables = variables end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(key) ⇒ Object
13 14 15 16 17 |
# File 'lib/serbea/component_renderer.rb', line 13 def method_missing(key) return @variables[key] if respond_to_missing?(key) super end |
Instance Method Details
#respond_to_missing?(key, include_private = false) ⇒ Boolean
9 10 11 |
# File 'lib/serbea/component_renderer.rb', line 9 def respond_to_missing?(key, include_private = false) @variables.key?(key) end |