Class: FFI::Clang::Lib::CXVersion

Inherits:
Struct
  • Object
show all
Defined in:
lib/ffi/clang/lib/cursor.rb

Overview

FFI struct representing a version number with major, minor, and subminor components.

Instance Method Summary collapse

Instance Method Details

#majorObject

Get the major version number.



407
408
409
# File 'lib/ffi/clang/lib/cursor.rb', line 407

def major
	self[:major]
end

#minorObject

Get the minor version number.



413
414
415
# File 'lib/ffi/clang/lib/cursor.rb', line 413

def minor
	self[:minor]
end

#subminorObject

Get the subminor version number.



419
420
421
# File 'lib/ffi/clang/lib/cursor.rb', line 419

def subminor
	self[:subminor]
end

#to_sObject

Convert to a string representation.



431
432
433
# File 'lib/ffi/clang/lib/cursor.rb', line 431

def to_s
	version_string
end

#version_stringObject

Get the version as a string.



425
426
427
# File 'lib/ffi/clang/lib/cursor.rb', line 425

def version_string
	[major, minor, subminor].reject{|v| v < 0}.map(&:to_s).join(".")
end