class EndpointFlux::Config::Interceptor
Attributes
handlers[RW]
Public Class Methods
new()
click to toggle source
# File lib/endpoint_flux/config/interceptor.rb, line 6 def initialize @handlers = [] end
Public Instance Methods
add(&block)
click to toggle source
# File lib/endpoint_flux/config/interceptor.rb, line 16 def add(&block) raise 'Block not given' unless block_given? handlers << block end
run(attrs)
click to toggle source
# File lib/endpoint_flux/config/interceptor.rb, line 10 def run(attrs) handlers.each { |handler| handler.call(attrs) } attrs end