Class: DocTemplate::Tables::MaterialMetadata

Inherits:
Base
  • Object
show all
Defined in:
lib/doc_template/tables/material_metadata.rb

Constant Summary collapse

CONFIG_PATH =
Rails.root.join('config', 'materials_rules.yml')
HEADER_LABEL =
'material-metadata'
HTML_VALUE_FIELDS =
[].freeze

Constants inherited from Base

Base::SPLIT_REGEX

Instance Attribute Summary

Attributes inherited from Base

#data, #errors

Instance Method Summary collapse

Methods inherited from Base

#collect_and_render_tags, #fetch_materials, #initialize, parse, #parse_in_context, #table_exist?

Constructor Details

This class inherits a constructor from DocTemplate::Tables::Base

Instance Method Details

#parse(fragment, *_args) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/doc_template/tables/material_metadata.rb', line 10

def parse(fragment, *_args)
  super
  if @data['sheet-type'].blank?
    @data['type'] ||= 'default'
    @data['sheet-type'] = config[@data['type']]
  end
  self
end