Class: Applocale::ParseModelModule::SheetContent

Inherits:
Object
  • Object
show all
Defined in:
lib/applocale/Core/ParseModel/parse_model_module.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sheetname) ⇒ SheetContent

Returns a new instance of SheetContent.



5
6
7
8
9
10
# File 'lib/applocale/Core/ParseModel/parse_model_module.rb', line 5

def initialize(sheetname)
  self.sheetname = sheetname
  self.rowinfo_list = Array.new
  self.lang_with_colno_list = Array.new
  self.comment = sheetname
end

Instance Attribute Details

#commentObject

Returns the value of attribute comment.



4
5
6
# File 'lib/applocale/Core/ParseModel/parse_model_module.rb', line 4

def comment
  @comment
end

#header_rownoObject

Returns the value of attribute header_rowno.



4
5
6
# File 'lib/applocale/Core/ParseModel/parse_model_module.rb', line 4

def header_rowno
  @header_rowno
end

#keyStr_with_colnoObject

Returns the value of attribute keyStr_with_colno.



4
5
6
# File 'lib/applocale/Core/ParseModel/parse_model_module.rb', line 4

def keyStr_with_colno
  @keyStr_with_colno
end

#lang_with_colno_listObject

Returns the value of attribute lang_with_colno_list.



4
5
6
# File 'lib/applocale/Core/ParseModel/parse_model_module.rb', line 4

def lang_with_colno_list
  @lang_with_colno_list
end

#rowinfo_listObject

Returns the value of attribute rowinfo_list.



4
5
6
# File 'lib/applocale/Core/ParseModel/parse_model_module.rb', line 4

def rowinfo_list
  @rowinfo_list
end

#sheetnameObject

Returns the value of attribute sheetname.



4
5
6
# File 'lib/applocale/Core/ParseModel/parse_model_module.rb', line 4

def sheetname
  @sheetname
end

Instance Method Details

#get_rowInfo_sortby_keyObject



12
13
14
# File 'lib/applocale/Core/ParseModel/parse_model_module.rb', line 12

def get_rowInfo_sortby_key
  return self.rowinfo_list.sort_by { |obj| obj.key_str.to_s }
end

#get_rowInfo_sortby_rownoObject



16
17
18
# File 'lib/applocale/Core/ParseModel/parse_model_module.rb', line 16

def get_rowInfo_sortby_rowno
  return self.rowinfo_list.sort_by { |obj| obj.rowno.to_i }
end

#to_sObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/applocale/Core/ParseModel/parse_model_module.rb', line 20

def to_s
  str_keyStr_with_colno = ''
  unless keyStr_with_colno.nil?
    str_keyStr_with_colno = "\n\t#{keyStr_with_colno.to_s}"
  end
  str_lang_with_colno_list = ''
  self.lang_with_colno_list.each do |langWithColNo|
    str_lang_with_colno_list += "\n\t#{langWithColNo.to_s}"
  end
  str_contentlist = '\n'
  self.get_rowInfo_sortby_rowno.each do |value|
    str_contentlist += "\t #{value.to_s}\n"
  end
  "sheetname = #{sheetname}\n" +
      "header_rowno = #{header_rowno}\n" +
      "keyStrWithColNo = #{str_keyStr_with_colno}\n" +
      "langWithColNo_list = #{str_lang_with_colno_list}\n" +
      "rowinfo_list = #{str_contentlist}"
end