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.



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

#formatObject (readonly)

Returns the value of attribute format.



8
9
10
# File 'lib/metanorma/release/publication.rb', line 8

def format
  @format
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/metanorma/release/publication.rb', line 8

def name
  @name
end

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

Returns:

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

#hashObject



21
22
23
# File 'lib/metanorma/release/publication.rb', line 21

def hash
  [format, path].hash
end

#to_hObject



25
26
27
# File 'lib/metanorma/release/publication.rb', line 25

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