Sha256: 8f19cfc65fcdae1b02b654a1507a0da4b0f24386d07ddeb79684c70b0f312adf

Contents?: true

Size: 507 Bytes

Versions: 12

Compression:

Stored size: 507 Bytes

Contents

require 'apotomo/event_handler'

module Apotomo
  class InvokeEventHandler < EventHandler
    attr_accessor :widget_id, :state
    
    def initialize(options={})
      @widget_id  = options[:widget_id]
      @state      = options[:state]
    end
    
    def process_event(event)
      target = event.source.root.find_by_path(widget_id) ### DISCUSS: widget_id or widget_selector?
      
      target.invoke(state, event)
    end
    
    def to_s; "InvokeEventHandler:#{widget_id}##{state}"; end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
apotomo-1.3.2 lib/apotomo/invoke_event_handler.rb
apotomo-1.3.1 lib/apotomo/invoke_event_handler.rb
apotomo-1.3.0 lib/apotomo/invoke_event_handler.rb
apotomo-1.2.6 lib/apotomo/invoke_event_handler.rb
apotomo-1.2.5 lib/apotomo/invoke_event_handler.rb
apotomo-1.2.4 lib/apotomo/invoke_event_handler.rb
apotomo-1.2.3 lib/apotomo/invoke_event_handler.rb
apotomo-1.2.2 lib/apotomo/invoke_event_handler.rb
apotomo-1.2.1 lib/apotomo/invoke_event_handler.rb
apotomo-1.2.0 lib/apotomo/invoke_event_handler.rb
apotomo-1.1.4 lib/apotomo/invoke_event_handler.rb
apotomo-1.1.3 lib/apotomo/invoke_event_handler.rb