This repository has been archived by the owner on Dec 11, 2021. It is now read-only.
forked from oauth-xx/oauth2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
21 changed files
with
128 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,59 @@ | ||
module OAuth2 | ||
class Version | ||
MAJOR = 1 | ||
MINOR = 0 | ||
PATCH = 0 | ||
PRE = nil | ||
|
||
class << self | ||
# @return [String] | ||
def to_s | ||
[MAJOR, MINOR, PATCH, PRE].compact.join('.') | ||
end | ||
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 |
Oops, something went wrong.