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.
17 18 19 20 21 22 |
# File 'lib/metanorma/release/publication.rb', line 17 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.
15 16 17 |
# File 'lib/metanorma/release/publication.rb', line 15 def format @format end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
15 16 17 |
# File 'lib/metanorma/release/publication.rb', line 15 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
15 16 17 |
# File 'lib/metanorma/release/publication.rb', line 15 def path @path end |
Instance Method Details
#eql?(other) ⇒ Boolean
24 25 26 |
# File 'lib/metanorma/release/publication.rb', line 24 def eql?(other) other.is_a?(self.class) && format == other.format && path == other.path end |
#hash ⇒ Object
28 29 30 |
# File 'lib/metanorma/release/publication.rb', line 28 def hash [format, path].hash end |
#to_h ⇒ Object
32 33 34 |
# File 'lib/metanorma/release/publication.rb', line 32 def to_h { "format" => format, "name" => name, "path" => path } end |