Class: Applocale::Config::SheetInfoByRow

Inherits:
Object
  • Object
show all
Defined in:
lib/applocale/Core/setting.rb,
lib/applocale/Core/ParseXLSX/parse_xlsx_module.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(row, key_col, lang_cols, use_export) ⇒ SheetInfoByRow

Returns a new instance of SheetInfoByRow.



116
117
118
119
120
121
# File 'lib/applocale/Core/setting.rb', line 116

def initialize(row, key_col, lang_cols, use_export)
  self.row = row
  self.key_col = key_col
  self.lang_cols = lang_cols
  self.use_export = use_export
end

Instance Attribute Details

#key_colObject

Returns the value of attribute key_col.



114
115
116
# File 'lib/applocale/Core/setting.rb', line 114

def key_col
  @key_col
end

#lang_colsObject

Returns the value of attribute lang_cols.



114
115
116
# File 'lib/applocale/Core/setting.rb', line 114

def lang_cols
  @lang_cols
end

#rowObject

Returns the value of attribute row.



114
115
116
# File 'lib/applocale/Core/setting.rb', line 114

def row
  @row
end

#use_exportObject

Returns the value of attribute use_export.



114
115
116
# File 'lib/applocale/Core/setting.rb', line 114

def use_export
  @use_export
end

Instance Method Details

#to_keyStrWithColNo(sheetcontent) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/applocale/Core/ParseXLSX/parse_xlsx_module.rb', line 24

def to_keyStrWithColNo(sheetcontent)
  sheetcontent.header_rowno = self.row
  keycolno = Applocale::ParseXLSXModule::Helper.collabel_to_colno(self.key_col)
  sheetcontent.keyStr_with_colno = Applocale::ParseModelModule::KeyStrWithColNo.new(nil, keycolno)
  sheetcontent.lang_with_colno_list = Array.new
  self.lang_cols.each do |lang, collabel|
    colno = Applocale::ParseXLSXModule::Helper.collabel_to_colno(collabel)
    obj = Applocale::ParseModelModule::LangWithColNo.new(nil,lang, colno)
    sheetcontent.lang_with_colno_list.push(obj)
  end
end

#to_sObject



123
124
125
# File 'lib/applocale/Core/setting.rb', line 123

def to_s
  return "row: #{self.row} | key_col: #{self.key_col} | lang_cols: #{self.lang_cols.to_s} | use_export: #{self.use_export}"
end