Class: LifxHttp::Api::WithDefaultSelector

Inherits:
Object
  • Object
show all
Defined in:
lib/lifx_http/api/with_default_selector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(selector) ⇒ WithDefaultSelector

Returns a new instance of WithDefaultSelector.



10
11
12
# File 'lib/lifx_http/api/with_default_selector.rb', line 10

def initialize(selector)
  @selector = selector
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object (private)



16
17
18
19
20
21
22
# File 'lib/lifx_http/api/with_default_selector.rb', line 16

def method_missing(method_name, *args)
  if ::LifxHttp::Api.respond_to? method_name
    ::LifxHttp::Api.public_send(method_name, selector, *args)
  else
    raise
  end
end

Instance Attribute Details

#selectorObject (readonly)

Returns the value of attribute selector.



8
9
10
# File 'lib/lifx_http/api/with_default_selector.rb', line 8

def selector
  @selector
end