Module: Glimmer::LibUI::CustomControl::GlimmerSupersedable

Defined in:
lib/glimmer/libui/custom_control.rb

Overview

This module was only created to prevent Glimmer from checking method_missing first

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/glimmer/libui/custom_control.rb', line 37

def method_missing(method_name, *args, &block)
  # TODO Consider supporting a glimmer error silencing option for methods defined here
  # but fail the glimmer DSL for the right reason to avoid seeing noise in the log output
  if block && can_handle_listener?(method_name)
    handle_listener(method_name, &block)
  elsif @body_root.respond_to?(method_name, true)
    @body_root.send(method_name, *args, &block)
  else
    super
  end
end

Instance Method Details

#respond_to?(method_name, *args, &block) ⇒ Boolean

Returns:

  • (Boolean)


49
50
51
52
53
54
# File 'lib/glimmer/libui/custom_control.rb', line 49

def respond_to?(method_name, *args, &block)
  result = false
  result ||= super
  result ||= can_handle_listener?(method_name)
  result ||= @body_root.respond_to?(method_name, *args, &block)
end