Class: SplttyCLI::Commands::TemplateScope
- Inherits:
-
Object
- Object
- SplttyCLI::Commands::TemplateScope
- Defined in:
- lib/spltty_cli/commands/install.rb
Overview
Plain binding holder for ERB — each key becomes a local-ish reader method,
so templates read <%= participants %> rather than <%= vars[:participants] %>.
Instance Method Summary collapse
- #binding_for ⇒ Object
-
#initialize(vars) ⇒ TemplateScope
constructor
A new instance of TemplateScope.
Constructor Details
#initialize(vars) ⇒ TemplateScope
Returns a new instance of TemplateScope.
405 406 407 |
# File 'lib/spltty_cli/commands/install.rb', line 405 def initialize(vars) vars.each { |k, v| define_singleton_method(k) { v } } end |
Instance Method Details
#binding_for ⇒ Object
409 410 411 |
# File 'lib/spltty_cli/commands/install.rb', line 409 def binding_for binding end |