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.



356
357
358
# File 'lib/ffi/clang/lib/cursor.rb', line 356

def major
	self[:major]
end

#minorObject

Get the minor version number.



362
363
364
# File 'lib/ffi/clang/lib/cursor.rb', line 362

def minor
	self[:minor]
end

#subminorObject

Get the subminor version number.



368
369
370
# File 'lib/ffi/clang/lib/cursor.rb', line 368

def subminor
	self[:subminor]
end

#to_sObject

Convert to a string representation.



380
381
382
# File 'lib/ffi/clang/lib/cursor.rb', line 380

def to_s
	version_string
end

#version_stringObject

Get the version as a string.



374
375
376
# File 'lib/ffi/clang/lib/cursor.rb', line 374

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