Class: I18nExport::Config
- Inherits:
-
Object
- Object
- I18nExport::Config
- Defined in:
- lib/i18n_export/config.rb
Defined Under Namespace
Classes: FileDefinition
Instance Method Summary collapse
- #file_definitions ⇒ Object
-
#initialize(filename = I18nExport.config_file) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(filename = I18nExport.config_file) ⇒ Config
Returns a new instance of Config.
8 9 10 11 12 13 |
# File 'lib/i18n_export/config.rb', line 8 def initialize(filename=I18nExport.config_file) # lets make sure the file exists raise Errno::ENOENT unless File.file?(filename) @filename = filename end |
Instance Method Details
#file_definitions ⇒ Object
15 16 17 18 19 |
# File 'lib/i18n_export/config.rb', line 15 def file_definitions (config["translations"] || []).map do |defn| FileDefinition.new(defn["file"], defn["only"]) end end |