Class: MachineHead::Tuner

Inherits:
Object
  • Object
show all
Defined in:
lib/machine_head/tuner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#deviceObject (readonly)

Returns the value of attribute device.



3
4
5
# File 'lib/machine_head/tuner.rb', line 3

def device
  @device
end

#idObject (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

#statusObject



32
33
34
# File 'lib/machine_head/tuner.rb', line 32

def status
  Status.new(get('status'))
end

#streaminfoObject



28
29
30
# File 'lib/machine_head/tuner.rb', line 28

def streaminfo
  get 'streaminfo'
end