Module: Twitter::Version

Defined in:
lib/twitter/version.rb

Overview

Provides version information for the Twitter gem

Class Method Summary collapse

Class Method Details

.majorInteger

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The major version number

Examples:

Twitter::Version.major # => 8

Returns:

  • (Integer)


13
14
15
# File 'lib/twitter/version.rb', line 13

def major
  8
end

.minorInteger

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The minor version number

Examples:

Twitter::Version.minor # => 3

Returns:

  • (Integer)


23
24
25
# File 'lib/twitter/version.rb', line 23

def minor
  3
end

.patchInteger

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The patch version number

Examples:

Twitter::Version.patch # => 0

Returns:

  • (Integer)


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

def patch
  0
end

.preInteger, NilClass

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The pre-release version identifier

Examples:

Twitter::Version.pre # => nil

Returns:

  • (Integer, NilClass)


43
44
# File 'lib/twitter/version.rb', line 43

def pre
end

.to_aArray

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The version as an array

Examples:

Twitter::Version.to_a # => [8, 3, 0]

Returns:

  • (Array)


62
63
64
# File 'lib/twitter/version.rb', line 62

def to_a
  [major, minor, patch]
end

.to_hHash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The version as a hash

Examples:

Twitter::Version.to_h # => {major: 8, minor: 3, patch: 0, pre: nil}

Returns:

  • (Hash)


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

def to_h
  {major:, minor:, patch:, pre: nil}
end

.to_sString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The version as a string

Examples:

Twitter::Version.to_s # => "8.3.0"

Returns:

  • (String)


72
73
74
# File 'lib/twitter/version.rb', line 72

def to_s
  to_a.join(".")
end