Class: Spree::ActionCallbacks

Inherits:
Object
  • Object
show all
Defined in:
lib/spree_core/action_callbacks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeActionCallbacks

Returns a new instance of ActionCallbacks.



7
8
9
10
11
# File 'lib/spree_core/action_callbacks.rb', line 7

def initialize
  @before_methods = []
  @after_methods = []
  @fails_methods = []
end

Instance Attribute Details

#after_methodsObject (readonly)

Returns the value of attribute after_methods.



4
5
6
# File 'lib/spree_core/action_callbacks.rb', line 4

def after_methods
  @after_methods
end

#before_methodsObject (readonly)

Returns the value of attribute before_methods.



3
4
5
# File 'lib/spree_core/action_callbacks.rb', line 3

def before_methods
  @before_methods
end

#fails_methodsObject (readonly)

Returns the value of attribute fails_methods.



5
6
7
# File 'lib/spree_core/action_callbacks.rb', line 5

def fails_methods
  @fails_methods
end

Instance Method Details

#after(method) ⇒ Object



17
18
19
# File 'lib/spree_core/action_callbacks.rb', line 17

def after(method)
  @after_methods << method
end

#before(method) ⇒ Object



13
14
15
# File 'lib/spree_core/action_callbacks.rb', line 13

def before(method)
  @before_methods << method
end

#fails(method) ⇒ Object



21
22
23
# File 'lib/spree_core/action_callbacks.rb', line 21

def fails(method)
  @fails_methods << method
end