Class: Spectre::Prompt::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/spectre/prompt.rb

Overview

Helper class to handle the binding for ERB template rendering

Instance Method Summary collapse

Constructor Details

#initialize(locals) ⇒ Context

Returns a new instance of Context.



125
126
127
128
129
# File 'lib/spectre/prompt.rb', line 125

def initialize(locals)
  locals.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
end

Instance Method Details

#get_bindingObject

Returns binding for ERB template rendering



132
133
134
# File 'lib/spectre/prompt.rb', line 132

def get_binding
  binding
end