Class: Glimmer::DSL::XML::TagExpression
- Inherits:
-
StaticExpression
- Object
- StaticExpression
- Glimmer::DSL::XML::TagExpression
- Includes:
- NodeParentExpression, TopLevelExpression
- Defined in:
- lib/glimmer/dsl/xml/tag_expression.rb
Instance Method Summary collapse
- #can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
- #interpret(parent, keyword, *args, &block) ⇒ Object
Methods included from NodeParentExpression
Instance Method Details
#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
35 36 37 38 39 |
# File 'lib/glimmer/dsl/xml/tag_expression.rb', line 35 def can_interpret?(parent, keyword, *args, &block) (parent == nil or parent.is_a?(Glimmer::XML::Node)) and (keyword.to_s == "tag") and args[0].include?(:_name) end |
#interpret(parent, keyword, *args, &block) ⇒ Object
41 42 43 44 45 46 |
# File 'lib/glimmer/dsl/xml/tag_expression.rb', line 41 def interpret(parent, keyword, *args, &block) attributes = args[0] if (args.size == 1) tag_name = attributes[:_name] attributes.delete(:_name) Glimmer::XML::Node.new(parent, tag_name, attributes, &block) end |