Methods
Attributes
| [R] | identifier | |
| [R] | kind | |
| [R] | method | |
| [R] | options |
Public Class methods
[ show source ]
# File lib/active_support/callbacks.rb, line 136
136: def initialize(kind, method, options = {})
137: @kind = kind
138: @method = method
139: @identifier = options[:identifier]
140: @options = options
141: end
Public Instance methods
[ show source ]
# File lib/active_support/callbacks.rb, line 143
143: def ==(other)
144: case other
145: when Callback
146: (self.identifier && self.identifier == other.identifier) || self.method == other.method
147: else
148: (self.identifier && self.identifier == other) || self.method == other
149: end
150: end
[ show source ]
# File lib/active_support/callbacks.rb, line 160
160: def call(*args, &block)
161: evaluate_method(method, *args, &block) if should_run_callback?(*args)
162: rescue LocalJumpError
163: raise ArgumentError,
164: "Cannot yield from a Proc type filter. The Proc must take two " +
165: "arguments and execute #call on the second argument."
166: end
[ show source ]
# File lib/active_support/callbacks.rb, line 156
156: def dup
157: self.class.new(@kind, @method, @options.dup)
158: end
[ show source ]
# File lib/active_support/callbacks.rb, line 152
152: def eql?(other)
153: self == other
154: end