Class: IronNails::View::BehaviorCommand
- Defined in:
- lib/ironnails/view/commands/behavior_command.rb
Instance Attribute Summary
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, #read_options, #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 Method Details
#async_delegate_command ⇒ Object
22 23 24 |
# File 'lib/ironnails/view/commands/behavior_command.rb', line 22 def async_delegate_command IronNails::Library::AsynchronousDelegateCommand end |
#delegate_command ⇒ Object
18 19 20 |
# File 'lib/ironnails/view/commands/behavior_command.rb', line 18 def delegate_command IronNails::Library::DelegateCommand end |
#to_clr_command ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ironnails/view/commands/behavior_command.rb', line 7 def to_clr_command # I have to wrap the method calls into blocks because .to_proc hasn't been implemented yet on method # the Func's have to be wrapped in lambda's to preserve the return statement. unless asynchronous? delegate_command.new(Action.new { execute }, Func[System::Boolean].new(&lambda{ can_execute? } )) else async_delegate_command.new(Action.new { execute }, Action.new { refresh_view }, Func[System::Boolean].new(&lambda{ can_execute? })) end end |