Class: Metanorma::Release::PublicationFile
- Inherits:
-
Object
- Object
- Metanorma::Release::PublicationFile
- Defined in:
- lib/metanorma/release/publication.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(format:, name:, path:) ⇒ PublicationFile
constructor
A new instance of PublicationFile.
- #to_h ⇒ Object
Constructor Details
#initialize(format:, name:, path:) ⇒ PublicationFile
Returns a new instance of PublicationFile.
10 11 12 13 14 15 |
# File 'lib/metanorma/release/publication.rb', line 10 def initialize(format:, name:, path:) @format = format @name = name @path = path freeze end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
8 9 10 |
# File 'lib/metanorma/release/publication.rb', line 8 def format @format end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/metanorma/release/publication.rb', line 8 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/metanorma/release/publication.rb', line 8 def path @path end |
Instance Method Details
#eql?(other) ⇒ Boolean
17 18 19 |
# File 'lib/metanorma/release/publication.rb', line 17 def eql?(other) other.is_a?(self.class) && format == other.format && path == other.path end |
#hash ⇒ Object
21 22 23 |
# File 'lib/metanorma/release/publication.rb', line 21 def hash [format, path].hash end |
#to_h ⇒ Object
25 26 27 |
# File 'lib/metanorma/release/publication.rb', line 25 def to_h { "format" => format, "name" => name, "path" => path } end |