Class: Metanorma::Release::PublicationFile

Inherits:
Object
  • Object
show all
Defined in:
lib/metanorma/release/publication.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#formatObject (readonly)

Returns the value of attribute format.



15
16
17
# File 'lib/metanorma/release/publication.rb', line 15

def format
  @format
end

#nameObject (readonly)

Returns the value of attribute name.



15
16
17
# File 'lib/metanorma/release/publication.rb', line 15

def name
  @name
end

#pathObject (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

Returns:

  • (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

#hashObject



28
29
30
# File 'lib/metanorma/release/publication.rb', line 28

def hash
  [format, path].hash
end

#to_hObject



32
33
34
# File 'lib/metanorma/release/publication.rb', line 32

def to_h
  { "format" => format, "name" => name, "path" => path }
end