Module: OAuth2::Version

Defined in:
lib/oauth2/version.rb

Constant Summary collapse

VERSION =
to_s

Class Method Summary collapse

Class Method Details

.majorInteger

The major version

Returns:

  • (Integer)


12
13
14
# File 'lib/oauth2/version.rb', line 12

def major
  1
end

.minorInteger

The minor version

Returns:

  • (Integer)


19
20
21
# File 'lib/oauth2/version.rb', line 19

def minor
  4
end

.patchInteger

The patch version

Returns:

  • (Integer)


26
27
28
# File 'lib/oauth2/version.rb', line 26

def patch
  7
end

.preString, NilClass

The pre-release version, if any

Returns:

  • (String, NilClass)


33
34
35
# File 'lib/oauth2/version.rb', line 33

def pre
  nil
end

.to_aArray

The version number as an array

Returns:

  • (Array)


52
53
54
# File 'lib/oauth2/version.rb', line 52

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

.to_hHash

The version number as a hash

Returns:

  • (Hash)


40
41
42
43
44
45
46
47
# File 'lib/oauth2/version.rb', line 40

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

.to_sString

The version number as a string

Returns:

  • (String)


59
60
61
62
63
# File 'lib/oauth2/version.rb', line 59

def to_s
  v = [major, minor, patch].compact.join('.')
  v += "-#{pre}" if pre
  v
end