Class: Glimmer::DSL::Libui::PropertyExpression

Inherits:
Expression
  • Object
show all
Defined in:
lib/glimmer/dsl/libui/property_expression.rb

Instance Method Summary collapse

Instance Method Details

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

Returns:

  • (Boolean)


31
32
33
34
35
36
37
38
39
# File 'lib/glimmer/dsl/libui/property_expression.rb', line 31

def can_interpret?(parent, keyword, *args, &block)
  (
    parent.is_a?(Glimmer::LibUI::ControlProxy) or
      parent.is_a?(Glimmer::LibUI::Shape) or
      parent.is_a?(Glimmer::LibUI::AttributedString)
  ) and
    block.nil? and
    parent.respond_to?("#{keyword}=", *args)
end

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



41
42
43
# File 'lib/glimmer/dsl/libui/property_expression.rb', line 41

def interpret(parent, keyword, *args, &block)
  parent.send("#{keyword}=", *args)
end