Class: Sheetah::TemplateConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/sheetah/template_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(types: Types::Container.new) ⇒ TemplateConfig

Returns a new instance of TemplateConfig.



7
8
9
# File 'lib/sheetah/template_config.rb', line 7

def initialize(types: Types::Container.new)
  @types = types
end

Instance Attribute Details

#typesObject (readonly)

Returns the value of attribute types.



11
12
13
# File 'lib/sheetah/template_config.rb', line 11

def types
  @types
end

Instance Method Details

#header(key, index) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/sheetah/template_config.rb', line 13

def header(key, index)
  header = key.to_s.capitalize
  header = "#{header} #{index + 1}" if index

  pattern = /^#{header}$/i

  [header, pattern]
end