Module: Hooked::ClassMethods

Defined in:
lib/hooked.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#instance_hookedObject (readonly)

Returns the value of attribute instance_hooked.



58
59
60
# File 'lib/hooked.rb', line 58

def instance_hooked
  @instance_hooked
end

Instance Method Details

#new_with_hooked(*args, &block) ⇒ Object



71
72
73
74
75
76
77
78
79
# File 'lib/hooked.rb', line 71

def new_with_hooked(*args, &block)
  obj = new_without_hooked *args, &block
  instance_hooked.each do |pointcut, aspects|
    aspects.each do |aspect|
      obj.send aspect[:type], pointcut, *aspect[:args], &aspect[:block]
    end
  end
  obj
end