Class: Applocale::ConvertFile
- Inherits:
-
Object
- Object
- Applocale::ConvertFile
- Defined in:
- lib/applocale/Util/convert_util.rb
Instance Attribute Summary collapse
-
#filepath ⇒ Object
Returns the value of attribute filepath.
Instance Method Summary collapse
- #has_append_other ⇒ Object
- #has_convent_to_locale ⇒ Object
- #has_is_skip_by_key ⇒ Object
- #has_parse_from_excel_or_csv ⇒ Object
- #has_parse_from_locale ⇒ Object
-
#initialize(convert_file, dir) ⇒ ConvertFile
constructor
A new instance of ConvertFile.
- #load_append_other(lang, target) ⇒ Object
- #load_convent_to_locale(lang, key, before_convert_value, after_convert_value) ⇒ Object
- #load_is_skip_by_key(sheetname, key) ⇒ Object
- #load_parse_from_excel_or_csv(sheetname, key, before_convert_value, after_convert_value) ⇒ Object
- #load_parse_from_locale(lang, key, before_convert_value, after_convert_value) ⇒ Object
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.(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
#filepath ⇒ Object
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_other ⇒ Object
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_locale ⇒ Object
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_key ⇒ Object
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_csv ⇒ Object
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_locale ⇒ Object
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 |