Class: QED::Advice
- Inherits:
-
Object
- Object
- QED::Advice
- Defined in:
- lib/qed/advice.rb,
lib/qed/advice/events.rb
Overview
Advice
This class tracks advice defined by demo scripts and helpers. It is instantiated in Scope, so that the advice methods will have access to the same local binding and the scripts themselves.
Defined Under Namespace
Classes: Events
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#patterns ⇒ Object
readonly
Returns the value of attribute patterns.
Instance Method Summary collapse
- #call(scope, type, *args) ⇒ Object
-
#initialize ⇒ Advice
constructor
A new instance of Advice.
Constructor Details
Instance Attribute Details
#events ⇒ Object (readonly)
Returns the value of attribute events.
17 18 19 |
# File 'lib/qed/advice.rb', line 17 def events @events end |
#patterns ⇒ Object (readonly)
Returns the value of attribute patterns.
15 16 17 |
# File 'lib/qed/advice.rb', line 15 def patterns @patterns end |
Instance Method Details
#call(scope, type, *args) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/qed/advice.rb', line 24 def call(scope, type, *args) case type when :when @patterns.call(scope, *args) else @events.call(scope, type, *args) end end |