Class: Assimp::Version

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/assimp/version.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(major, minor, revision) ⇒ Version

Returns a new instance of Version.



11
12
13
14
15
# File 'lib/assimp/version.rb', line 11

def initialize(major, minor, revision)
  @major = major
  @minor = minor
  @revision = revision
end

Instance Attribute Details

#majorObject (readonly)

Returns the value of attribute major.



9
10
11
# File 'lib/assimp/version.rb', line 9

def major
  @major
end

#minorObject (readonly)

Returns the value of attribute minor.



9
10
11
# File 'lib/assimp/version.rb', line 9

def minor
  @minor
end

#revisionObject (readonly)

Returns the value of attribute revision.



9
10
11
# File 'lib/assimp/version.rb', line 9

def revision
  @revision
end

Instance Method Details

#<=>(other) ⇒ Object



17
18
19
20
21
22
# File 'lib/assimp/version.rb', line 17

def <=>(other)
  res = (major <=> other.major)
  res = (minor <=> other.minor) if res == 0
  res = (revision <=> other.revision) if res == 0
  res
end

#to_sObject



24
25
26
# File 'lib/assimp/version.rb', line 24

def to_s
  "#{major}.#{minor}.#{revision}"
end