Class: Aspect4r::Model::Advice
- Inherits:
-
Object
- Object
- Aspect4r::Model::Advice
- Defined in:
- lib/aspect4r/model/advice.rb
Constant Summary collapse
- BEFORE =
1
- AFTER =
2
- AROUND =
3
Instance Attribute Summary collapse
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#options ⇒ Object
Returns the value of attribute options.
-
#type ⇒ Object
Returns the value of attribute type.
-
#with_method ⇒ Object
Returns the value of attribute with_method.
Instance Method Summary collapse
- #after? ⇒ Boolean
- #around? ⇒ Boolean
- #before? ⇒ Boolean
- #before_filter? ⇒ Boolean
-
#initialize(type, with_method, group, options = {}) ⇒ Advice
constructor
A new instance of Advice.
- #invoke(obj, *args) ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(type, with_method, group, options = {}) ⇒ Advice
Returns a new instance of Advice.
11 12 13 14 15 16 |
# File 'lib/aspect4r/model/advice.rb', line 11 def initialize type, with_method, group, = {} @type = type @with_method = with_method @group = group @options = end |
Instance Attribute Details
#group ⇒ Object (readonly)
Returns the value of attribute group.
8 9 10 |
# File 'lib/aspect4r/model/advice.rb', line 8 def group @group end |
#options ⇒ Object
Returns the value of attribute options.
9 10 11 |
# File 'lib/aspect4r/model/advice.rb', line 9 def @options end |
#type ⇒ Object
Returns the value of attribute type.
9 10 11 |
# File 'lib/aspect4r/model/advice.rb', line 9 def type @type end |
#with_method ⇒ Object
Returns the value of attribute with_method.
9 10 11 |
# File 'lib/aspect4r/model/advice.rb', line 9 def with_method @with_method end |
Instance Method Details
#after? ⇒ Boolean
30 31 32 |
# File 'lib/aspect4r/model/advice.rb', line 30 def after? type == AFTER end |
#around? ⇒ Boolean
34 35 36 |
# File 'lib/aspect4r/model/advice.rb', line 34 def around? type == AROUND end |
#before? ⇒ Boolean
22 23 24 |
# File 'lib/aspect4r/model/advice.rb', line 22 def before? type == BEFORE and not [:skip_if_false] end |
#before_filter? ⇒ Boolean
26 27 28 |
# File 'lib/aspect4r/model/advice.rb', line 26 def before_filter? type == BEFORE and [:skip_if_false] end |
#invoke(obj, *args) ⇒ Object
38 39 40 |
# File 'lib/aspect4r/model/advice.rb', line 38 def invoke obj, *args obj.send with_method, *args end |
#name ⇒ Object
18 19 20 |
# File 'lib/aspect4r/model/advice.rb', line 18 def name [:name] || with_method end |