Class: Spectre::Prompt::Context
- Inherits:
-
Object
- Object
- Spectre::Prompt::Context
- Defined in:
- lib/spectre/prompt.rb
Overview
Helper class to handle the binding for ERB rendering
Instance Method Summary collapse
-
#get_binding ⇒ Object
Returns binding for ERB template rendering.
-
#initialize(locals) ⇒ Context
constructor
A new instance of Context.
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_binding ⇒ Object
Returns binding for ERB template rendering
60 61 62 |
# File 'lib/spectre/prompt.rb', line 60 def get_binding binding end |