Class: Brule::Context

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/brule.rb

Class Method Summary collapse

Instance Method Summary collapse

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