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 template 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.
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_binding ⇒ Object
Returns binding for ERB template rendering
132 133 134 |
# File 'lib/spectre/prompt.rb', line 132 def get_binding binding end |