Class: Spectre::Prompt::Context

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

Overview

Helper class to handle the binding for ERB rendering

Instance Method Summary collapse

Constructor Details

#initialize(locals) ⇒ Context

Returns a new instance of Context.



53
54
55
56
57
# File 'lib/spectre/prompt.rb', line 53

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



60
61
62
# File 'lib/spectre/prompt.rb', line 60

def get_binding
  binding
end