Class: Aspect4r::Model::AspectData

Inherits:
Array
  • Object
show all
Defined in:
lib/aspect4r/model/aspect_data.rb

Instance Method Summary collapse

Constructor Details

#initialize(klass_or_module) ⇒ AspectData

Returns a new instance of AspectData.



6
7
8
# File 'lib/aspect4r/model/aspect_data.rb', line 6

def initialize klass_or_module
  @group = klass_or_module.hash
end

Instance Method Details

#advices_for_method(method) ⇒ Object



26
27
28
29
# File 'lib/aspect4r/model/aspect_data.rb', line 26

def advices_for_method method
  method = method.to_s
  select {|advice| advice.method_matcher.match?(method) }
end

#change_groupObject



22
23
24
# File 'lib/aspect4r/model/aspect_data.rb', line 22

def change_group
  @group_index = group_index + 1
end

#groupObject



18
19
20
# File 'lib/aspect4r/model/aspect_data.rb', line 18

def group
  "#{@group}:#{group_index}"
end

#group_indexObject



14
15
16
# File 'lib/aspect4r/model/aspect_data.rb', line 14

def group_index
  @group_index ||= 0
end

#wrapped_methodsObject



10
11
12
# File 'lib/aspect4r/model/aspect_data.rb', line 10

def wrapped_methods
  @wrapped_methods ||= {}
end