Class: IronNails::View::EventCommand
- Defined in:
- lib/ironnails/view/commands/event_command.rb
Overview
Encapsulates commands that will be attached to elements in the views.
Instance Attribute Summary collapse
-
#affinity ⇒ Object
the name of the on which this command needs to be invoked.
-
#element ⇒ Object
the name of the element that will trigger the action.
-
#trigger ⇒ Object
the name of the event that will trigger the action.
Attributes inherited from Command
#action, #callback, #condition, #controller, #mode, #name, #view
Instance Method Summary collapse
Methods inherited from Command
#<=>, #==, #asynchronous?, #attached?, #can_execute?, #changed?, #execute, #has_callback?, #initialize, #refresh_view, #synchronise_viewmodel_with_controller
Methods included from Core::Observable
#add_observer, #count_observers, #delete_observer, #delete_observers, #notify_observers
Methods included from Logging::ClassLogger
Constructor Details
This class inherits a constructor from IronNails::View::Command
Instance Attribute Details
#affinity ⇒ Object
the name of the on which this command needs to be invoked
15 16 17 |
# File 'lib/ironnails/view/commands/event_command.rb', line 15 def affinity @affinity end |
#element ⇒ Object
the name of the element that will trigger the action
12 13 14 |
# File 'lib/ironnails/view/commands/event_command.rb', line 12 def element @element end |
#trigger ⇒ Object
the name of the event that will trigger the action
9 10 11 |
# File 'lib/ironnails/view/commands/event_command.rb', line 9 def trigger @trigger end |
Instance Method Details
#nails_base_command_read_options ⇒ Object
17 |
# File 'lib/ironnails/view/commands/event_command.rb', line 17 alias_method :nails_base_command_read_options, :read_options |
#read_options(options) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/ironnails/view/commands/event_command.rb', line 19 def () raise ArgumentException.new("An element name is necesary") if [:element].nil? @trigger = [:event]||:click @element = [:element] @affinity = [:affinity] end |