Class: Raudi::Proxy::Controller
- Inherits:
-
Object
- Object
- Raudi::Proxy::Controller
- Includes:
- ExternalInterrupt, GPIO, Headers, Timer
- Defined in:
- lib/raudi/proxy/controller.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
Returns the value of attribute controller.
Instance Method Summary collapse
-
#initialize(controller, &block) ⇒ Controller
constructor
A new instance of Controller.
Methods included from Timer
#activate_counter, #activate_timer
Methods included from Headers
Methods included from GPIO
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
#controller ⇒ Object
Returns the value of attribute controller.
17 18 19 |
# File 'lib/raudi/proxy/controller.rb', line 17 def controller @controller end |