Class: Glimmer::DSL::SWT::PropertyExpression

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

Instance Method Summary collapse

Methods inherited from Expression

#add_content, dsl, #textual?, #widget?

Instance Method Details

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

Returns:

  • (Boolean)


7
8
9
10
11
12
13
# File 'lib/glimmer/dsl/swt/property_expression.rb', line 7

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

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



15
16
17
18
# File 'lib/glimmer/dsl/swt/property_expression.rb', line 15

def interpret(parent, keyword, *args, &block)
  parent.set_attribute(keyword, *args)
  nil
end