Class: Super::Controls

Inherits:
Object
  • Object
show all
Defined in:
lib/super/controls.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dashboard) ⇒ Controls

Returns a new instance of Controls.



3
4
5
# File 'lib/super/controls.rb', line 3

def initialize(dashboard)
  @dashboard = dashboard
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/super/controls.rb', line 9

def method_missing(method_name, *args)
  if @dashboard.respond_to?(method_name)
    @dashboard.public_send(method_name, *args)
  else
    super
  end
end

Instance Attribute Details

#dashboardObject (readonly)

Returns the value of attribute dashboard.



7
8
9
# File 'lib/super/controls.rb', line 7

def dashboard
  @dashboard
end

Instance Method Details

#respond_to_missing?(method_name, _ = false) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
20
21
22
23
# File 'lib/super/controls.rb', line 17

def respond_to_missing?(method_name, _ = false)
  if @dashboard.respond_to?(method_name)
    true
  else
    super
  end
end