Class: Glimmer::DSL::Libui::ListenerExpression

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

Instance Method Summary collapse

Instance Method Details

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

Returns:

  • (Boolean)


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

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::CustomControl) or
    parent.is_a?(Glimmer::LibUI::CustomShape)
  ) and
    block_given? and
    parent.respond_to?(:can_handle_listener?) and
    parent.can_handle_listener?(keyword)
end

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



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

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