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) ⇒ SheetInfoByRow

Returns a new instance of SheetInfoByRow.



110
111
112
113
114
# File 'lib/applocale/Core/setting.rb', line 110

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

Instance Attribute Details

#key_colObject

Returns the value of attribute key_col.



108
109
110
# File 'lib/applocale/Core/setting.rb', line 108

def key_col
  @key_col
end

#lang_colsObject

Returns the value of attribute lang_cols.



108
109
110
# File 'lib/applocale/Core/setting.rb', line 108

def lang_cols
  @lang_cols
end

#rowObject

Returns the value of attribute row.



108
109
110
# File 'lib/applocale/Core/setting.rb', line 108

def row
  @row
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



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

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