class FlowObject::Callbacks
Constants
- NOOP
- SUPPORTED
Public Class Methods
new()
click to toggle source
# File lib/flow_object/callbacks.rb, line 13 def initialize @callbacks = Hash.new { |hash, key| hash[key] = NOOP } end
Public Instance Methods
method_missing(name, *_attrs, &block)
click to toggle source
Calls superclass method
# File lib/flow_object/callbacks.rb, line 17 def method_missing(name, *_attrs, &block) if SUPPORTED.include?(name) block_given? ? @callbacks[name] = block : @callbacks[name] else super end end
respond_to_missing?(name, *)
click to toggle source
# File lib/flow_object/callbacks.rb, line 25 def respond_to_missing?(name, *) SUPPORTED.include?(name) end