Class: Spree::Admin::ActionCallbacks
- Inherits:
-
Object
- Object
- Spree::Admin::ActionCallbacks
- Defined in:
- lib/spree/admin/action_callbacks.rb
Instance Attribute Summary collapse
-
#after_methods ⇒ Object
readonly
Returns the value of attribute after_methods.
-
#before_methods ⇒ Object
readonly
Returns the value of attribute before_methods.
-
#fails_methods ⇒ Object
readonly
Returns the value of attribute fails_methods.
Instance Method Summary collapse
- #after(method) ⇒ Object
- #before(method) ⇒ Object
- #fails(method) ⇒ Object
-
#initialize ⇒ ActionCallbacks
constructor
A new instance of ActionCallbacks.
Constructor Details
#initialize ⇒ ActionCallbacks
Returns a new instance of ActionCallbacks.
8 9 10 11 12 |
# File 'lib/spree/admin/action_callbacks.rb', line 8 def initialize @before_methods = [] @after_methods = [] @fails_methods = [] end |
Instance Attribute Details
#after_methods ⇒ Object (readonly)
Returns the value of attribute after_methods.
5 6 7 |
# File 'lib/spree/admin/action_callbacks.rb', line 5 def after_methods @after_methods end |
#before_methods ⇒ Object (readonly)
Returns the value of attribute before_methods.
4 5 6 |
# File 'lib/spree/admin/action_callbacks.rb', line 4 def before_methods @before_methods end |
#fails_methods ⇒ Object (readonly)
Returns the value of attribute fails_methods.
6 7 8 |
# File 'lib/spree/admin/action_callbacks.rb', line 6 def fails_methods @fails_methods end |
Instance Method Details
#after(method) ⇒ Object
18 19 20 |
# File 'lib/spree/admin/action_callbacks.rb', line 18 def after(method) @after_methods << method end |
#before(method) ⇒ Object
14 15 16 |
# File 'lib/spree/admin/action_callbacks.rb', line 14 def before(method) @before_methods << method end |
#fails(method) ⇒ Object
22 23 24 |
# File 'lib/spree/admin/action_callbacks.rb', line 22 def fails(method) @fails_methods << method end |