Class: Artoo::Adaptors::Firmata
- Defined in:
- lib/artoo/adaptors/firmata.rb
Instance Attribute Summary collapse
-
#firmata ⇒ Object
readonly
Returns the value of attribute firmata.
Attributes inherited from Adaptor
Instance Method Summary collapse
Methods inherited from Adaptor
#connect_to, #connect_to_serial, #connect_to_tcp, #connect_to_udp, #connected?, #initialize, #reconnect
Constructor Details
This class inherits a constructor from Artoo::Adaptors::Adaptor
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *arguments, &block) ⇒ Object
20 21 22 |
# File 'lib/artoo/adaptors/firmata.rb', line 20 def method_missing(method_name, *arguments, &block) firmata.send(method_name, *arguments, &block) end |
Instance Attribute Details
#firmata ⇒ Object (readonly)
Returns the value of attribute firmata.
6 7 8 |
# File 'lib/artoo/adaptors/firmata.rb', line 6 def firmata @firmata end |
Instance Method Details
#connect ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/artoo/adaptors/firmata.rb', line 8 def connect require 'firmata' unless defined?(::Firmata) @firmata = ::Firmata::Board.new(connect_to) @firmata.connect super return true end |
#disconnect ⇒ Object
16 17 18 |
# File 'lib/artoo/adaptors/firmata.rb', line 16 def disconnect super end |