class DocTemplate::Tables::MaterialMetadata

Constants

CONFIG_PATH
HEADER_LABEL
HTML_VALUE_FIELDS

Public Instance Methods

parse(fragment, *_args) click to toggle source
Calls superclass method DocTemplate::Tables::Base::parse
# 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

Private Instance Methods

config() click to toggle source
# File lib/doc_template/tables/material_metadata.rb, line 21
def config
  @config ||= YAML.load_file(CONFIG_PATH)['sheet_types']
end