Module: OAuth2::Version

Defined in:
lib/oauth2/version.rb

Class Method Summary collapse

Class Method Details

.majorInteger

The major version

Returns:

  • (Integer)

8
9
10
# File 'lib/oauth2/version.rb', line 8

def major
  1
end

.minorInteger

The minor version

Returns:

  • (Integer)

15
16
17
# File 'lib/oauth2/version.rb', line 15

def minor
  4
end

.patchInteger

The patch version

Returns:

  • (Integer)

22
23
24
# File 'lib/oauth2/version.rb', line 22

def patch
  1
end

.preInteger, NilClass

The pre-release version, if any

Returns:

  • (Integer, NilClass)

29
30
31
# File 'lib/oauth2/version.rb', line 29

def pre
  nil
end

.to_aArray

The version number as an array

Returns:

  • (Array)

48
49
50
# File 'lib/oauth2/version.rb', line 48

def to_a
  [major, minor, patch, pre].compact
end

.to_hHash

The version number as a hash

Returns:

  • (Hash)

36
37
38
39
40
41
42
43
# File 'lib/oauth2/version.rb', line 36

def to_h
  {
    :major => major,
    :minor => minor,
    :patch => patch,
    :pre => pre,
  }
end

.to_sString

The version number as a string

Returns:

  • (String)

55
56
57
# File 'lib/oauth2/version.rb', line 55

def to_s
  to_a.join('.')
end