Class: Raudi::Proxy::Controller

Inherits:
Object
  • Object
show all
Includes:
ExternalInterrupt, GPIO, Headers, Timer
Defined in:
lib/raudi/proxy/controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Timer

#activate_counter, #activate_timer

Methods included from Headers

#headers

Methods included from GPIO

#output, #pullup

Methods included from ExternalInterrupt

#external_interrupt, #pc_interrupt

Constructor Details

#initialize(controller, &block) ⇒ Controller

Returns a new instance of Controller.



19
20
21
22
# File 'lib/raudi/proxy/controller.rb', line 19

def initialize(controller, &block)
  self.controller = controller
  instance_eval(&block) if block_given?
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



38
39
40
41
42
43
44
# File 'lib/raudi/proxy/controller.rb', line 38

def method_missing(method_name, *args)
  if controller.respond_to?("#{method_name}=")
    controller.send("#{method_name}=", *args)
  else
    raise "Illegal property #{method_name}, check configuration file"
  end
end

Instance Attribute Details

#controllerObject

Returns the value of attribute controller.



17
18
19
# File 'lib/raudi/proxy/controller.rb', line 17

def controller
  @controller
end