Class: Metanorma::Release::PublicationSource
- Inherits:
-
Object
- Object
- Metanorma::Release::PublicationSource
- Defined in:
- lib/metanorma/release/publication.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#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.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(owner:, repo:, tag:, url:, date:) ⇒ PublicationSource
constructor
A new instance of PublicationSource.
- #repo_key ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(owner:, repo:, tag:, url:, date:) ⇒ PublicationSource
Returns a new instance of PublicationSource.
40 41 42 43 44 45 46 47 |
# File 'lib/metanorma/release/publication.rb', line 40 def initialize(owner:, repo:, tag:, url:, date:) @owner = owner @repo = repo @tag = tag @url = url @date = date freeze end |
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
38 39 40 |
# File 'lib/metanorma/release/publication.rb', line 38 def date @date end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
38 39 40 |
# File 'lib/metanorma/release/publication.rb', line 38 def owner @owner end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
38 39 40 |
# File 'lib/metanorma/release/publication.rb', line 38 def repo @repo end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
38 39 40 |
# File 'lib/metanorma/release/publication.rb', line 38 def tag @tag end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
38 39 40 |
# File 'lib/metanorma/release/publication.rb', line 38 def url @url end |
Instance Method Details
#eql?(other) ⇒ Boolean
53 54 55 |
# File 'lib/metanorma/release/publication.rb', line 53 def eql?(other) other.is_a?(self.class) && owner == other.owner && repo == other.repo && tag == other.tag end |
#hash ⇒ Object
57 58 59 |
# File 'lib/metanorma/release/publication.rb', line 57 def hash [owner, repo, tag].hash end |
#repo_key ⇒ Object
49 50 51 |
# File 'lib/metanorma/release/publication.rb', line 49 def repo_key "#{owner}/#{repo}" end |
#to_h ⇒ Object
61 62 63 64 |
# File 'lib/metanorma/release/publication.rb', line 61 def to_h { "owner" => owner, "repo" => repo, "tag" => tag, "releaseUrl" => url, "releaseDate" => date } end |