class Cura::Event::Middleware::Aimer::Base

The base class for event middleware which set's a target, if needed.

Public Instance Methods

call(options={}) click to toggle source

Call this middleware.

@param [#to_h] options @option options [Event::Dispatcher] :dispatcher @option options [Event::Base] :event @option options [Attributes::HasEvents] :target The optional target of the event.

# File lib/cura/event/middleware/aimer/base.rb, line 15
def call(options={})
  set_target(options) if should_aim?(options)
end

Protected Instance Methods

set_target(_options={}) click to toggle source
# File lib/cura/event/middleware/aimer/base.rb, line 25
def set_target(_options={})
  # Does nothing on purpose
end
should_aim?(options={}) click to toggle source
# File lib/cura/event/middleware/aimer/base.rb, line 21
def should_aim?(options={})
  options[:event].target.nil?
end