Class: Net::SCP::Version

Class | Net::SCP::Version
In: | lib/net/scp/version.rb
Parent: | Object

A class for describing the current version of a library. The version consists of three parts: the `major` number, the `minor` number, and the `tiny` (or `patch`) number.

Two Version instances may be compared, so that you can test that a version of a library is what you require:

      require 'net/scp/version'

      if Net::SCP::Version::CURRENT < Net::SCP::Version[2,1,0]
        abort "your software is too old!"
      end

### Methods

<=> [] new to_i to_s

### Included Modules

Comparable

### Constants

MAJOR | = | 4 |  | The major component of this version of the Net::SSH library
MINOR | = | 1 |  | The minor component of this version of the Net::SSH library
TINY | = | 0 |  | The tiny component of this version of the Net::SSH library
PRE | = | nil |  | The prerelease component of this version of the Net::SSH library nil allowed
CURRENT | = | new(*[MAJOR, MINOR, TINY, PRE].compact) |  | The current version of the Net::SSH library as a Version instance
STRING | = | CURRENT.to_s |  | The current version of the Net::SSH library as a String

### Attributes

major | [R] |
minor | [R] |
tiny | [R] |

### Public Class methods

[](major, minor, tiny, pre = nil)

A convenience method for instantiating a new Version instance with the given `major`, `minor`, and `tiny` components.

new(major, minor, tiny, pre = nil)

Create a new Version object with the given components.

### Public Instance methods

<=>(version)

Compare this version to the given `version` object.

to_i()

Converts this version to a canonical integer that may be compared against other version objects.

to_s()

Converts this version object to a string, where each of the three version components are joined by the ’.’ character. E.g., 2.0.0.

[Validate]