class Behavior
Constants
- KINDS
Public Class Methods
new(behavior)
click to toggle source
# File lib/embed_callbacks/behavior.rb, line 4 def initialize(behavior) @behavior = behavior raise ArgumentError, 'The behavior should be set in the ' + KINDS.join(' ') unless KINDS.include?(behavior) end
Public Instance Methods
after?()
click to toggle source
# File lib/embed_callbacks/behavior.rb, line 13 def after? %i(after around).include?(@behavior) end
before?()
click to toggle source
# File lib/embed_callbacks/behavior.rb, line 9 def before? %i(before around).include?(@behavior) end
ensure?()
click to toggle source
# File lib/embed_callbacks/behavior.rb, line 21 def ensure? :ensure == @behavior end
rescue?()
click to toggle source
# File lib/embed_callbacks/behavior.rb, line 17 def rescue? :rescue == @behavior end