Class: Fontist::Utils::GitHubUrl::ParsedUrl
- Inherits:
-
Object
- Object
- Fontist::Utils::GitHubUrl::ParsedUrl
- Defined in:
- lib/fontist/utils/github_url.rb
Instance Attribute Summary collapse
-
#asset ⇒ Object
readonly
Returns the value of attribute asset.
-
#original_url ⇒ Object
readonly
Returns the value of attribute original_url.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(owner:, repo:, tag:, asset:, original_url:) ⇒ ParsedUrl
constructor
A new instance of ParsedUrl.
- #matched? ⇒ Boolean
Constructor Details
#initialize(owner:, repo:, tag:, asset:, original_url:) ⇒ ParsedUrl
Returns a new instance of ParsedUrl.
33 34 35 36 37 38 39 |
# File 'lib/fontist/utils/github_url.rb', line 33 def initialize(owner:, repo:, tag:, asset:, original_url:) @owner = owner @repo = repo @tag = tag @asset = asset @original_url = original_url end |
Instance Attribute Details
#asset ⇒ Object (readonly)
Returns the value of attribute asset.
31 32 33 |
# File 'lib/fontist/utils/github_url.rb', line 31 def asset @asset end |
#original_url ⇒ Object (readonly)
Returns the value of attribute original_url.
31 32 33 |
# File 'lib/fontist/utils/github_url.rb', line 31 def original_url @original_url end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
31 32 33 |
# File 'lib/fontist/utils/github_url.rb', line 31 def owner @owner end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
31 32 33 |
# File 'lib/fontist/utils/github_url.rb', line 31 def repo @repo end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
31 32 33 |
# File 'lib/fontist/utils/github_url.rb', line 31 def tag @tag end |
Class Method Details
.from_non_github_url(original_url) ⇒ Object
41 42 43 44 |
# File 'lib/fontist/utils/github_url.rb', line 41 def self.from_non_github_url(original_url) new(owner: nil, repo: nil, tag: nil, asset: nil, original_url: original_url) end |
Instance Method Details
#matched? ⇒ Boolean
46 47 48 |
# File 'lib/fontist/utils/github_url.rb', line 46 def matched? !owner.nil? end |