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.



398
399
400
# File 'lib/spltty_cli/commands/install.rb', line 398

def initialize(vars)
  vars.each { |k, v| define_singleton_method(k) { v } }
end

Instance Method Details

#binding_forObject



402
403
404
# File 'lib/spltty_cli/commands/install.rb', line 402

def binding_for
  binding
end