Skip to content
90262ae Jan 30, 2016
@sferik @mbleigh
60 lines (52 sloc) 856 Bytes
module OAuth2
module Version
module_function
# The major version
#
# @return [Integer]
def major
1
end
# The minor version
#
# @return [Integer]
def minor
1
end
# The patch version
#
# @return [Integer]
def patch
0
end
# The pre-release version, if any
#
# @return [Integer, NilClass]
def pre
nil
end
# The version number as a hash
#
# @return [Hash]
def to_h
{
:major => major,
:minor => minor,
:patch => patch,
:pre => pre,
}
end
# The version number as an array
#
# @return [Array]
def to_a
[major, minor, patch, pre].compact
end
# The version number as a string
#
# @return [String]
def to_s
to_a.join('.')
end
end
end
Something went wrong with that request. Please try again.