Class: Glimmer::DSL::XML::NameSpaceExpression
- Inherits:
-
StaticExpression
- Object
- StaticExpression
- Glimmer::DSL::XML::NameSpaceExpression
- Includes:
- ParentExpression, TopLevelExpression
- Defined in:
- lib/glimmer/dsl/xml/name_space_expression.rb
Instance Method Summary collapse
- #add_content(parent, keyword, *args, &block) ⇒ Object
- #can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
- #interpret(parent, keyword, *args, &block) ⇒ Object
Instance Method Details
#add_content(parent, keyword, *args, &block) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/glimmer/dsl/xml/name_space_expression.rb', line 49 def add_content(parent, keyword, *args, &block) node = block.call(parent) unless node.is_a?(String) name_space_visitor = Glimmer::XML::NameSpaceVisitor.new(parent.name) Glimmer::XML::DepthFirstSearchIterator.new(node, name_space_visitor).iterate # def node.process_block(block) # Glimmer::Config.logger&.debug 'block' # end end parent.children << node if parent and !parent.children.include?(node) node end |
#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean
36 37 38 39 40 41 42 |
# File 'lib/glimmer/dsl/xml/name_space_expression.rb', line 36 def can_interpret?(parent, keyword, *args, &block) (parent == nil or parent.is_a?(Glimmer::XML::Node)) and (keyword.to_s == "name_space") (args.size == 1) and (args[0].is_a?(Symbol)) and block end |