Class: Glimmer::DSL::Opal::PropertyExpression

Inherits:
StaticExpression
  • Object
show all
Includes:
TopLevelExpression
Defined in:
lib/glimmer/dsl/opal/property_expression.rb

Instance Method Summary collapse

Instance Method Details

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

Returns:

  • (Boolean)


9
10
11
12
13
14
# File 'lib/glimmer/dsl/opal/property_expression.rb', line 9

def can_interpret?(parent, keyword, *args, &block)          
  parent and 
    parent.respond_to?(:set_attribute) and 
    keyword and 
    block.nil?
end

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



16
17
18
19
20
21
22
# File 'lib/glimmer/dsl/opal/property_expression.rb', line 16

def interpret(parent, keyword, *args, &block)
  if keyword == 'text' # TODO move into property converters in element proxy
    args = [args.first.to_s.gsub('&', '')]
  end
  parent.set_attribute(keyword, *args)
  args.first.to_s
end