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.



152
153
154
155
156
# File 'lib/spectre/prompt.rb', line 152

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



159
160
161
# File 'lib/spectre/prompt.rb', line 159

def get_binding
  binding
end