-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Always return URIs instead of strings
Standardize on URI over URL.
- Loading branch information
Showing
27 changed files
with
695 additions
and
256 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
require 'twitter/entity' | ||
|
||
module Twitter | ||
class Entity | ||
class URI < Twitter::Entity | ||
|
||
# @return [URI] | ||
def display_uri | ||
@display_uri ||= ::URI.parse(@attrs[:display_url]) if display_uri? | ||
end | ||
alias display_url display_uri | ||
|
||
# @return [Boolean] | ||
def display_uri? | ||
!!@attrs[:display_url] | ||
end | ||
alias display_url? display_uri? | ||
|
||
# @return [URI] | ||
def expanded_uri | ||
@expanded_uri ||= ::URI.parse(@attrs[:expanded_url]) if expanded_uri? | ||
end | ||
alias expanded_url expanded_uri | ||
|
||
# @return [Boolean] | ||
def expanded_uri? | ||
!!@attrs[:expanded_url] | ||
end | ||
alias expanded_url? expanded_uri? | ||
|
||
# @return [URI] | ||
def uri | ||
@uri ||= ::URI.parse(@attrs[:url]) if uri? | ||
end | ||
alias url uri | ||
|
||
# @return [Boolean] | ||
def uri? | ||
!!@attrs[:url] | ||
end | ||
alias url? uri? | ||
|
||
end | ||
|
||
Uri = URI | ||
URL = URI | ||
Url = URI | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.