Class: MachineHead::Tuner
- Inherits:
-
Object
- Object
- MachineHead::Tuner
- Defined in:
- lib/machine_head/tuner.rb
Instance Attribute Summary collapse
-
#device ⇒ Object
readonly
Returns the value of attribute device.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #get(command) ⇒ Object
-
#initialize(device, id) ⇒ Tuner
constructor
A new instance of Tuner.
- #set(command, data) ⇒ Object
- #status ⇒ Object
- #streaminfo ⇒ Object
Constructor Details
#initialize(device, id) ⇒ Tuner
Returns a new instance of Tuner.
5 6 7 8 |
# File 'lib/machine_head/tuner.rb', line 5 def initialize(device, id) @device = device @id = id end |
Instance Attribute Details
#device ⇒ Object (readonly)
Returns the value of attribute device.
3 4 5 |
# File 'lib/machine_head/tuner.rb', line 3 def device @device end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/machine_head/tuner.rb', line 3 def id @id end |
Instance Method Details
#get(command) ⇒ Object
10 11 12 |
# File 'lib/machine_head/tuner.rb', line 10 def get(command) device.get("/tuner#{id}/#{command}") end |
#set(command, data) ⇒ Object
14 15 16 |
# File 'lib/machine_head/tuner.rb', line 14 def set(command, data) device.set("/tuner#{id}/#{command}", data) end |
#status ⇒ Object
32 33 34 |
# File 'lib/machine_head/tuner.rb', line 32 def status Status.new(get('status')) end |
#streaminfo ⇒ Object
28 29 30 |
# File 'lib/machine_head/tuner.rb', line 28 def streaminfo get 'streaminfo' end |