Class: Glimmer::DSL::XML::TagExpression
- Inherits:
-
StaticExpression
- Object
- Expression
- StaticExpression
- Glimmer::DSL::XML::TagExpression
- Includes:
- TopLevelExpression, NodeParentExpression
- Defined in:
- lib/glimmer/dsl/xml/tag_expression.rb
Constant Summary
Constants included from Glimmer
Instance Method Summary collapse
- #can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
- #interpret(parent, keyword, *args, &block) ⇒ Object
Methods included from NodeParentExpression
Methods included from Glimmer
Methods included from ParentExpression
Methods inherited from StaticExpression
Methods inherited from Expression
#add_content, dsl, #textual?, #widget?
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Glimmer
Instance Method Details
#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
14 15 16 17 18 |
# File 'lib/glimmer/dsl/xml/tag_expression.rb', line 14 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
20 21 22 23 24 25 |
# File 'lib/glimmer/dsl/xml/tag_expression.rb', line 20 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 |