Class: Translatomatic::ResourceFile::CSV
- Defined in:
- lib/translatomatic/resource_file/csv.rb
Overview
CSV resource file
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.extensions ⇒ Array<String>
File extensions supported by this resource file.
Instance Method Summary collapse
-
#save(target = path, options = {}) ⇒ void
Save the resource file.
Methods inherited from Base
#create_variable, enabled?, #format, #get, #initialize, is_key_value?, #locale_path, #sentences, #set, supports_variable_interpolation?, #to_s, #type, #variable_regex
Constructor Details
This class inherits a constructor from Translatomatic::ResourceFile::Base
Class Method Details
.extensions ⇒ Array<String>
Returns File extensions supported by this resource file.
8 9 10 |
# File 'lib/translatomatic/resource_file/csv.rb', line 8 def self.extensions %w{csv} end |
Instance Method Details
#save(target = path, options = {}) ⇒ void
This method returns an undefined value.
Save the resource file.
13 14 15 16 17 18 19 |
# File 'lib/translatomatic/resource_file/csv.rb', line 13 def save(target = path, = {}) ::CSV.open(target, "wb") do |csv| @properties.each do |key, value| csv << [key, value] end end end |