Class: V
- Inherits:
-
Gem::Version
- Object
- Gem::Version
- V
- Defined in:
- lib/v1.rb
Constant Summary collapse
- VERSION =
'0.0.1'
Instance Method Summary collapse
- #build ⇒ Object (also: #patch, #tiny)
- #major ⇒ Object
- #minor ⇒ Object
- #numeric ⇒ Object
Instance Method Details
#build ⇒ Object Also known as: patch, tiny
12 13 14 |
# File 'lib/v1.rb', line 12 def build return segments[2] end |
#major ⇒ Object
4 5 6 |
# File 'lib/v1.rb', line 4 def major return segments[0] end |
#minor ⇒ Object
8 9 10 |
# File 'lib/v1.rb', line 8 def minor return segments[1] end |
#numeric ⇒ Object
18 19 20 21 22 23 |
# File 'lib/v1.rb', line 18 def numeric return @numeric ||= begin major, minor, build = segments major + 0.001 * minor.to_i + 0.000001 * build.to_i end end |