Class: Brule::Context
- Inherits:
-
Object
- Object
- Brule::Context
- Extended by:
- Forwardable
- Defined in:
- lib/brule/context.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ Context
constructor
A new instance of Context.
- #initialize_copy(orig) ⇒ Object
Constructor Details
#initialize(hash = {}) ⇒ Context
Returns a new instance of Context.
13 14 15 |
# File 'lib/brule/context.rb', line 13 def initialize(hash = {}) @content = hash end |
Class Method Details
.wrap(context) ⇒ Object
9 10 11 |
# File 'lib/brule/context.rb', line 9 def self.wrap(context) context.is_a?(self) ? context : new(context) end |
Instance Method Details
#initialize_copy(orig) ⇒ Object
17 18 19 20 |
# File 'lib/brule/context.rb', line 17 def initialize_copy(orig) super @content = orig.instance_variable_get(:@content).dup end |