Class: Rcurse::Context
- Inherits:
-
Object
- Object
- Rcurse::Context
- Defined in:
- lib/rcurse/context.rb
Overview
Template context
Instance Attribute Summary (collapse)
-
- (Object) path
Template directory path.
Instance Method Summary (collapse)
-
- (Object) eval(code)
Evaluate Ruby code inside the context.
-
- (Binding) get_binding
Get Binding object for the context.
-
- (Context) initialize(path = nil)
constructor
Create a new context.
Constructor Details
- (Context) initialize(path = nil)
Create a new context
7 8 9 10 |
# File 'lib/rcurse/context.rb', line 7 def initialize path = nil @binding = binding @path = path end |
Instance Attribute Details
- (Object) path
Template directory path
27 28 29 |
# File 'lib/rcurse/context.rb', line 27 def path @path end |
Instance Method Details
- (Object) eval(code)
Evaluate Ruby code inside the context
22 23 24 |
# File 'lib/rcurse/context.rb', line 22 def eval code @binding.eval code end |
- (Binding) get_binding
Get Binding object for the context
14 15 16 |
# File 'lib/rcurse/context.rb', line 14 def get_binding @binding end |