Class: Pedalboard::Device
- Inherits:
-
Object
- Object
- Pedalboard::Device
- Defined in:
- lib/pedalboard/device.rb
Instance Attribute Summary collapse
-
#board ⇒ Object
readonly
Returns the value of attribute board.
-
#components ⇒ Object
readonly
Returns the value of attribute components.
-
#midi_input ⇒ Object
readonly
Returns the value of attribute midi_input.
-
#midi_output ⇒ Object
readonly
Returns the value of attribute midi_output.
Instance Method Summary collapse
- #add_component(type, opts = {}) ⇒ Object
-
#initialize(opts = {}) ⇒ Device
constructor
A new instance of Device.
Constructor Details
#initialize(opts = {}) ⇒ Device
Returns a new instance of Device.
9 10 11 12 13 14 15 |
# File 'lib/pedalboard/device.rb', line 9 def initialize opts={} @components = [] @connection = opts.fetch(:connection) { Dino::TxRx::Serial.new } @board = opts.fetch(:board) { Dino::Board.new(connection) } @midi_output = opts.fetch(:midi_output) { UniMIDI::Output.gets } @midi_input = opts.fetch(:midi_input) { UniMIDI::Input.gets } end |
Instance Attribute Details
#board ⇒ Object (readonly)
Returns the value of attribute board.
7 8 9 |
# File 'lib/pedalboard/device.rb', line 7 def board @board end |
#components ⇒ Object (readonly)
Returns the value of attribute components.
7 8 9 |
# File 'lib/pedalboard/device.rb', line 7 def components @components end |
#midi_input ⇒ Object (readonly)
Returns the value of attribute midi_input.
7 8 9 |
# File 'lib/pedalboard/device.rb', line 7 def midi_input @midi_input end |
#midi_output ⇒ Object (readonly)
Returns the value of attribute midi_output.
7 8 9 |
# File 'lib/pedalboard/device.rb', line 7 def midi_output @midi_output end |
Instance Method Details
#add_component(type, opts = {}) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/pedalboard/device.rb', line 17 def add_component type, opts={} opts[:pedalboard] = self component = eval(component_class(type)) .new(opts) components << component component end |