Class: Glimmer::DSL::XML::TextExpression

Inherits:
StaticExpression
  • Object
show all
Defined in:
lib/glimmer/dsl/xml/text_expression.rb

Instance Method Summary collapse

Instance Method Details

#can_interpret?(parent, keyword, *args, &block) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
32
33
34
# File 'lib/glimmer/dsl/xml/text_expression.rb', line 29

def can_interpret?(parent, keyword, *args, &block)
  (parent == nil or parent.is_a?(Glimmer::XML::Node)) and
  (keyword.to_s == "text") and
  (args.size == 1) and
  !block
end

#interpret(parent, keyword, *args, &block) ⇒ Object



36
37
38
39
# File 'lib/glimmer/dsl/xml/text_expression.rb', line 36

def interpret(parent, keyword, *args, &block)
  parent.children << args[0].to_s if parent
  args[0].to_s
end