Class: Pebbles::Git::Version
- Inherits:
-
Object
- Object
- Pebbles::Git::Version
- Includes:
- Comparable
- Defined in:
- lib/pebbles/git.rb
Instance Attribute Summary collapse
-
#major ⇒ Object
Returns the value of attribute major.
-
#minor ⇒ Object
Returns the value of attribute minor.
-
#patch ⇒ Object
Returns the value of attribute patch.
-
#special ⇒ Object
Returns the value of attribute special.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(major, minor = 0, patch = 0, special = 0) ⇒ Version
constructor
A new instance of Version.
Constructor Details
#initialize(major, minor = 0, patch = 0, special = 0) ⇒ Version
Returns a new instance of Version.
53 54 55 |
# File 'lib/pebbles/git.rb', line 53 def initialize(major, minor=0, patch=0, special=0) @major, @minor, @patch, @special = major, minor, patch, special end |
Instance Attribute Details
#major ⇒ Object
Returns the value of attribute major.
51 52 53 |
# File 'lib/pebbles/git.rb', line 51 def major @major end |
#minor ⇒ Object
Returns the value of attribute minor.
51 52 53 |
# File 'lib/pebbles/git.rb', line 51 def minor @minor end |
#patch ⇒ Object
Returns the value of attribute patch.
51 52 53 |
# File 'lib/pebbles/git.rb', line 51 def patch @patch end |
#special ⇒ Object
Returns the value of attribute special.
51 52 53 |
# File 'lib/pebbles/git.rb', line 51 def special @special end |
Class Method Details
Instance Method Details
#<=>(other) ⇒ Object
62 63 64 65 66 67 |
# File 'lib/pebbles/git.rb', line 62 def <=>(other) return major <=> other.major unless (major <=> other.major) == 0 return minor <=> other.minor unless (minor <=> other.minor) == 0 return patch <=> other.patch unless (patch <=> other.patch) == 0 return special <=> other.special end |