Class: Artoo::Interfaces::Interface
- Inherits:
-
Object
- Object
- Artoo::Interfaces::Interface
- Includes:
- Celluloid, Celluloid::Notifications
- Defined in:
- lib/artoo/interfaces/interface.rb
Overview
The Interface class is the base class used to implement behavior for a specific category of robot. Examples would be a Rover or Copter.
Derive a class from this class, in order to implement higher-order behavior for a new category of robot.
Constant Summary collapse
- COMMANDS =
[].freeze
Instance Attribute Summary collapse
-
#device ⇒ Object
Returns the value of attribute device.
-
#name ⇒ Object
Returns the value of attribute name.
-
#robot ⇒ Object
Returns the value of attribute robot.
Instance Method Summary collapse
-
#commands ⇒ Collection
Commands.
-
#initialize(params = {}) ⇒ Interface
constructor
Create new interface.
- #interface_type ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Interface
Create new interface
25 26 27 28 29 |
# File 'lib/artoo/interfaces/interface.rb', line 25 def initialize(params={}) @name = params[:name] @robot = params[:robot] @device = params[:device] end |
Instance Attribute Details
#device ⇒ Object
Returns the value of attribute device.
13 14 15 |
# File 'lib/artoo/interfaces/interface.rb', line 13 def device @device end |
#name ⇒ Object
Returns the value of attribute name.
13 14 15 |
# File 'lib/artoo/interfaces/interface.rb', line 13 def name @name end |
#robot ⇒ Object
Returns the value of attribute robot.
13 14 15 |
# File 'lib/artoo/interfaces/interface.rb', line 13 def robot @robot end |
Instance Method Details
#commands ⇒ Collection
Returns commands.
32 33 34 |
# File 'lib/artoo/interfaces/interface.rb', line 32 def commands self.class.const_get('COMMANDS') end |
#interface_type ⇒ Object
15 16 17 |
# File 'lib/artoo/interfaces/interface.rb', line 15 def interface_type :raw end |