Class: WidgetMethodCommandHandler

Inherits:
Object
  • Object
show all
Includes:
CommandHandler
Defined in:
lib/command_handlers/widget_method_command_handler.rb

Instance Method Summary collapse

Instance Method Details

#can_handle?(parent, command_symbol, *args, &block) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
# File 'lib/command_handlers/widget_method_command_handler.rb', line 7

def can_handle?(parent, command_symbol, *args, &block)
  parent.is_a?(RWidget) and 
    args.size > 0 and
    block == nil and
    parent.has_attribute?(command_symbol, *args)
end

#do_handle(parent, command_symbol, *args, &block) ⇒ Object



14
15
16
17
# File 'lib/command_handlers/widget_method_command_handler.rb', line 14

def do_handle(parent, command_symbol, *args, &block) 
  parent.set_attribute(command_symbol, *args)
  nil
end