Class: Brule::Context
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.
54 55 56 |
# File 'lib/brule.rb', line 54 def initialize(hash = {}) @content = hash end |
Class Method Details
.wrap(context) ⇒ Object
50 51 52 |
# File 'lib/brule.rb', line 50 def self.wrap(context) context.is_a?(self) ? context : new(context) end |
Instance Method Details
#initialize_copy(orig) ⇒ Object
58 59 60 61 |
# File 'lib/brule.rb', line 58 def initialize_copy(orig) super @content = orig.instance_variable_get(:@content).dup end |