Class: SplttyCLI::Commands::TemplateScope

Inherits:
Object
  • Object
show all
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

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_forObject



409
410
411
# File 'lib/spltty_cli/commands/install.rb', line 409

def binding_for
  binding
end