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.
33 34 35 36 37 38 39 40 |
# File 'lib/metanorma/release/publication.rb', line 33 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.
31 32 33 |
# File 'lib/metanorma/release/publication.rb', line 31 def date @date end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
31 32 33 |
# File 'lib/metanorma/release/publication.rb', line 31 def owner @owner end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
31 32 33 |
# File 'lib/metanorma/release/publication.rb', line 31 def repo @repo end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
31 32 33 |
# File 'lib/metanorma/release/publication.rb', line 31 def tag @tag end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
31 32 33 |
# File 'lib/metanorma/release/publication.rb', line 31 def url @url end |
Instance Method Details
#eql?(other) ⇒ Boolean
46 47 48 |
# File 'lib/metanorma/release/publication.rb', line 46 def eql?(other) other.is_a?(self.class) && owner == other.owner && repo == other.repo && tag == other.tag end |
#hash ⇒ Object
50 51 52 |
# File 'lib/metanorma/release/publication.rb', line 50 def hash [owner, repo, tag].hash end |
#repo_key ⇒ Object
42 43 44 |
# File 'lib/metanorma/release/publication.rb', line 42 def repo_key "#{owner}/#{repo}" end |
#to_h ⇒ Object
54 55 56 57 |
# File 'lib/metanorma/release/publication.rb', line 54 def to_h { "owner" => owner, "repo" => repo, "tag" => tag, "releaseUrl" => url, "releaseDate" => date } end |