Class: WidgetCommandHandler

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

Instance Method Summary collapse

Instance Method Details

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

Returns:

  • (Boolean)


9
10
11
12
13
# File 'lib/command_handlers/widget_command_handler.rb', line 9

def can_handle?(parent, command_symbol, *args, &block)
  parent.is_a?(RWidget) and 
    command_symbol.to_s != "shell" and
    RWidget.widget_exists?(command_symbol.to_s)
end

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



15
16
17
18
# File 'lib/command_handlers/widget_command_handler.rb', line 15

def do_handle(parent, command_symbol, *args, &block)
  Glimmer.logger.debug "widget styles are: " + args.inspect
  RWidget.new(command_symbol.to_s, parent.widget, args)
end