Sha256: 58f299cfbc26296ca7b97a5c24c6faee56c608b379085b39e91b4961db5af595

Contents?: true

Size: 499 Bytes

Versions: 21

Compression:

Stored size: 499 Bytes

Contents

require File.dirname(__FILE__) + "/../command_handler"
require File.dirname(__FILE__) + "/models/node"

class XmlTextCommandHandler
  include CommandHandler
  
  def can_handle?(parent, command_symbol, *args, &block)
    (parent == nil or parent.is_a?(Node)) and
    (command_symbol.to_s == "text") and
    ((args.size == 1) and (args[0].is_a?(String))) and
    !block
  end
  
  def do_handle(parent, command_symbol, *args, &block)
    parent.children << args[0] if parent
    args[0]
  end
  
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
glimmer-0.3.5 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.3.4 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.3.3 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.3.2 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.3.1 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.2.5 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.2.4 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.2.3 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.2.2 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.2.1 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.2.0 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.1.11.SWT4.14 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.1.11.470 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.1.10.470 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.1.9.470 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.1.8.470 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.1.5.470 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.1.4.470 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.1.4.swt.pre.4.7.0 lib/xml_command_handlers/xml_text_command_handler.rb
glimmer-0.1.3 lib/xml_command_handlers/xml_text_command_handler.rb