Class: Metanorma::Release::DocumentMetadata

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, title:, version:, doctype:, document_type:, flavor:, revdate:, source_path:, output_dir:, formats:, file_base_name:) ⇒ DocumentMetadata

Returns a new instance of DocumentMetadata.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/metanorma/release/document_metadata.rb', line 10

def initialize(id:, title:, version:, doctype:, document_type:,
               flavor:, revdate:, source_path:, output_dir:,
               formats:, file_base_name:)
  @id = id
  @title = title
  @version = version
  @doctype = doctype
  @document_type = document_type
  @flavor = flavor
  @revdate = revdate
  @source_path = source_path
  @output_dir = output_dir
  @formats = formats.freeze
  @file_base_name = file_base_name
  @lookup = {
    'id' => @id, 'title' => @title, 'doctype' => @doctype,
    'document_type' => @document_type, 'flavor' => @flavor,
    'revdate' => @revdate, 'source_path' => @source_path,
    'output_dir' => @output_dir, 'formats' => @formats,
    'file_base_name' => @file_base_name
  }.freeze
  freeze
end

Instance Attribute Details

#doctypeObject (readonly)

Returns the value of attribute doctype.



6
7
8
# File 'lib/metanorma/release/document_metadata.rb', line 6

def doctype
  @doctype
end

#document_typeObject (readonly)

Returns the value of attribute document_type.



6
7
8
# File 'lib/metanorma/release/document_metadata.rb', line 6

def document_type
  @document_type
end

#file_base_nameObject (readonly)

Returns the value of attribute file_base_name.



6
7
8
# File 'lib/metanorma/release/document_metadata.rb', line 6

def file_base_name
  @file_base_name
end

#flavorObject (readonly)

Returns the value of attribute flavor.



6
7
8
# File 'lib/metanorma/release/document_metadata.rb', line 6

def flavor
  @flavor
end

#formatsObject (readonly)

Returns the value of attribute formats.



6
7
8
# File 'lib/metanorma/release/document_metadata.rb', line 6

def formats
  @formats
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/metanorma/release/document_metadata.rb', line 6

def id
  @id
end

#output_dirObject (readonly)

Returns the value of attribute output_dir.



6
7
8
# File 'lib/metanorma/release/document_metadata.rb', line 6

def output_dir
  @output_dir
end

#revdateObject (readonly)

Returns the value of attribute revdate.



6
7
8
# File 'lib/metanorma/release/document_metadata.rb', line 6

def revdate
  @revdate
end

#source_pathObject (readonly)

Returns the value of attribute source_path.



6
7
8
# File 'lib/metanorma/release/document_metadata.rb', line 6

def source_path
  @source_path
end

#titleObject (readonly)

Returns the value of attribute title.



6
7
8
# File 'lib/metanorma/release/document_metadata.rb', line 6

def title
  @title
end

#versionObject (readonly)

Returns the value of attribute version.



6
7
8
# File 'lib/metanorma/release/document_metadata.rb', line 6

def version
  @version
end

Instance Method Details

#[](key) ⇒ Object



34
35
36
# File 'lib/metanorma/release/document_metadata.rb', line 34

def [](key)
  @lookup[key]
end