Class: Assimp::Version
- Inherits:
-
Object
- Object
- Assimp::Version
- Includes:
- Comparable
- Defined in:
- lib/assimp/version.rb
Instance Attribute Summary collapse
-
#major ⇒ Object
readonly
Returns the value of attribute major.
-
#minor ⇒ Object
readonly
Returns the value of attribute minor.
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(major, minor, revision) ⇒ Version
constructor
A new instance of Version.
- #to_s ⇒ Object
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
#major ⇒ Object (readonly)
Returns the value of attribute major.
9 10 11 |
# File 'lib/assimp/version.rb', line 9 def major @major end |
#minor ⇒ Object (readonly)
Returns the value of attribute minor.
9 10 11 |
# File 'lib/assimp/version.rb', line 9 def minor @minor end |
#revision ⇒ Object (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_s ⇒ Object
24 25 26 |
# File 'lib/assimp/version.rb', line 24 def to_s "#{major}.#{minor}.#{revision}" end |