Class: Cauldron::Scope
- Inherits:
-
Object
- Object
- Cauldron::Scope
- Includes:
- Enumerable
- Defined in:
- lib/cauldron/scope.rb
Instance Attribute Summary collapse
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
Instance Method Summary collapse
- #[](index) ⇒ Object
-
#initialize(variables) ⇒ Scope
constructor
A new instance of Scope.
- #new_variable! ⇒ Object
Constructor Details
#initialize(variables) ⇒ Scope
8 9 10 |
# File 'lib/cauldron/scope.rb', line 8 def initialize(variables) @variables = variables end |
Instance Attribute Details
#variables ⇒ Object (readonly)
Returns the value of attribute variables.
6 7 8 |
# File 'lib/cauldron/scope.rb', line 6 def variables @variables end |
Instance Method Details
#[](index) ⇒ Object
18 19 20 |
# File 'lib/cauldron/scope.rb', line 18 def [](index) variables[index] end |
#new_variable! ⇒ Object
12 13 14 15 16 |
# File 'lib/cauldron/scope.rb', line 12 def new_variable! #@variables << "var#{variables.length+1}" @variables << "var#{variables.length}" @variables.last end |