Class: LIBUSB::Version

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/libusb/version_struct.rb

Instance Method Summary collapse

Instance Method Details

#describeObject

For ABI compatibility only.


50
51
52
# File 'lib/libusb/version_struct.rb', line 50

def describe
  self[:describe].read_string
end

#inspectObject


59
60
61
# File 'lib/libusb/version_struct.rb', line 59

def inspect
  "\#<#{self.class} #{to_s}>"
end

#majorObject

Library major version.


28
29
30
# File 'lib/libusb/version_struct.rb', line 28

def major
  self[:major]
end

#microObject

Library micro version.


36
37
38
# File 'lib/libusb/version_struct.rb', line 36

def micro
  self[:micro]
end

#minorObject

Library minor version.


32
33
34
# File 'lib/libusb/version_struct.rb', line 32

def minor
  self[:minor]
end

#nanoObject

Library nano version.


40
41
42
# File 'lib/libusb/version_struct.rb', line 40

def nano
  self[:nano]
end

#rcObject

Library release candidate suffix string, e.g. “-rc4”.


45
46
47
# File 'lib/libusb/version_struct.rb', line 45

def rc
  self[:rc].read_string
end

#to_sObject

Version string, e.g. “1.2.3-rc4”


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

def to_s
  "#{major}.#{minor}.#{micro}#{rc}"
end