Sha256: 80ef61bef5878bc9d4da3ebc557ea7993904664cf737b3ae7f6fa248cced03c9
Contents?: true
Size: 730 Bytes
Versions: 4
Compression:
Stored size: 730 Bytes
Contents
require "facets" require File.dirname(__FILE__) + "/../command_handler" require File.dirname(__FILE__) + "/models/node" module Glimmer class XmlTagCommandHandler include CommandHandler def can_handle?(parent, command_symbol, *args, &block) (parent == nil or parent.is_a?(Node)) and (command_symbol.to_s == "tag") and ((args.size == 1) and ((args[0].is_a?(Hash)) or (args[0].is_a?(Hash)))) and args[0].include?(:_name) end def do_handle(parent, command_symbol, *args, &block) attributes = nil attributes = args[0] if (args.size == 1) tag_name = attributes[:_name] attributes.delete(:_name) Node.new(parent, tag_name, attributes, &block) end end end
Version data entries
4 entries across 4 versions & 1 rubygems