forked from sferik/twitter-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert Twitter::Version class to a module
- Loading branch information
Showing
2 changed files
with
36 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
module Twitter | ||
class Version | ||
class << self | ||
# @return [Integer] | ||
def major | ||
6 | ||
end | ||
module Version | ||
module_function | ||
|
||
# @return [Integer] | ||
def minor | ||
0 | ||
end | ||
# @return [Integer] | ||
def major | ||
6 | ||
end | ||
|
||
# @return [Integer] | ||
def patch | ||
0 | ||
end | ||
# @return [Integer] | ||
def minor | ||
0 | ||
end | ||
|
||
# @return [Integer, NilClass] | ||
def pre | ||
nil | ||
end | ||
# @return [Integer] | ||
def patch | ||
0 | ||
end | ||
|
||
# @return [Hash] | ||
def to_h | ||
{ | ||
major: major, | ||
minor: minor, | ||
patch: patch, | ||
pre: pre, | ||
} | ||
end | ||
# @return [Integer, NilClass] | ||
def pre | ||
nil | ||
end | ||
|
||
# @return [Array] | ||
def to_a | ||
to_h.values.compact | ||
end | ||
# @return [Hash] | ||
def to_h | ||
{ | ||
major: major, | ||
minor: minor, | ||
patch: patch, | ||
pre: pre, | ||
} | ||
end | ||
|
||
# @return [Array] | ||
def to_a | ||
to_h.values.compact | ||
end | ||
|
||
# @return [String] | ||
def to_s | ||
to_a.join('.') | ||
end | ||
# @return [String] | ||
def to_s | ||
to_a.join('.') | ||
end | ||
end | ||
end |