Class: Usbmux::MuxDevice

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, usbprod, serial, location) ⇒ MuxDevice

Returns a new instance of MuxDevice.



48
49
50
51
52
53
# File 'lib/usbmux/usbmux.rb', line 48

def initialize(id, usbprod, serial, location)
  @id = id
  @usbprod = usbprod
  @serial = serial
  @location = location
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



46
47
48
# File 'lib/usbmux/usbmux.rb', line 46

def id
  @id
end

#locationObject

Returns the value of attribute location.



46
47
48
# File 'lib/usbmux/usbmux.rb', line 46

def location
  @location
end

#serialObject

Returns the value of attribute serial.



46
47
48
# File 'lib/usbmux/usbmux.rb', line 46

def serial
  @serial
end

#usbprodObject

Returns the value of attribute usbprod.



46
47
48
# File 'lib/usbmux/usbmux.rb', line 46

def usbprod
  @usbprod
end

Instance Method Details

#to_sObject



55
56
57
# File 'lib/usbmux/usbmux.rb', line 55

def to_s
  "<MuxDevice: ID #{@id} ProdID 0x#{@usbprod.to_s.rjust(4, '0')} Serial '#{@serial}' Location 0x#{@usbprod.to_s.rjust(4, '0')}>"
end