Class: Applocale::ConvertFile

Inherits:
Object
  • Object
show all
Defined in:
lib/applocale/Util/convert_util.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(convert_file, dir) ⇒ ConvertFile

Returns a new instance of ConvertFile.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/applocale/Util/convert_util.rb', line 13

def initialize(convert_file, dir)
  unless convert_file.nil?
    if convert_file.to_s.strip.length > 0
      convertFilePath = File.expand_path(convert_file, dir)
      if File.exist?(convertFilePath)
        require convertFilePath
        @convert = Convert.new()
        @filepath = convertFilePath.to_s
        return
      else
        ErrorUtil::ConfigFileInValid.new('convert file not exist ').raise
      end
    end
  end
  @convert = Object.new()
end

Instance Attribute Details

#filepathObject

Returns the value of attribute filepath.



7
8
9
# File 'lib/applocale/Util/convert_util.rb', line 7

def filepath
  @filepath
end

Instance Method Details

#has_append_otherObject



71
72
73
# File 'lib/applocale/Util/convert_util.rb', line 71

def has_append_other
  return defined?(@convert.append_other) == 'method'
end

#has_convent_to_localeObject



31
32
33
# File 'lib/applocale/Util/convert_util.rb', line 31

def has_convent_to_locale
  return defined?(@convert.convent_to_locale) == 'method'
end

#has_is_skip_by_keyObject



51
52
53
# File 'lib/applocale/Util/convert_util.rb', line 51

def has_is_skip_by_key
  return defined?(@convert.is_skip_by_key) == 'method'
end

#has_parse_from_excel_or_csvObject



61
62
63
# File 'lib/applocale/Util/convert_util.rb', line 61

def has_parse_from_excel_or_csv
  return defined?(@convert.parse_from_excel_or_csv) == 'method'
end

#has_parse_from_localeObject



41
42
43
# File 'lib/applocale/Util/convert_util.rb', line 41

def has_parse_from_locale
  return defined?(@convert.parse_from_locale) == 'method'
end

#load_append_other(lang, target) ⇒ Object



76
77
78
# File 'lib/applocale/Util/convert_util.rb', line 76

def load_append_other(lang, target)
  return @convert.append_other(lang, target)
end

#load_convent_to_locale(lang, key, before_convert_value, after_convert_value) ⇒ Object



36
37
38
# File 'lib/applocale/Util/convert_util.rb', line 36

def load_convent_to_locale(lang, key, before_convert_value, after_convert_value)
  return @convert.convent_to_locale(lang, key, before_convert_value, after_convert_value)
end

#load_is_skip_by_key(sheetname, key) ⇒ Object



56
57
58
# File 'lib/applocale/Util/convert_util.rb', line 56

def load_is_skip_by_key(sheetname, key)
  return @convert.is_skip_by_key(sheetname, key)
end

#load_parse_from_excel_or_csv(sheetname, key, before_convert_value, after_convert_value) ⇒ Object



66
67
68
# File 'lib/applocale/Util/convert_util.rb', line 66

def load_parse_from_excel_or_csv(sheetname, key, before_convert_value, after_convert_value)
  return @convert.parse_from_excel_or_csv(sheetname, key, before_convert_value, after_convert_value)
end

#load_parse_from_locale(lang, key, before_convert_value, after_convert_value) ⇒ Object



46
47
48
# File 'lib/applocale/Util/convert_util.rb', line 46

def load_parse_from_locale(lang, key, before_convert_value, after_convert_value)
  return @convert.parse_from_locale(lang, key, before_convert_value, after_convert_value)
end