Class: Translate::Storage
- Inherits:
-
Object
- Object
- Translate::Storage
- Defined in:
- lib/translate/storage.rb
Instance Attribute Summary collapse
-
#locale ⇒ Object
Returns the value of attribute locale.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(locale) ⇒ Storage
constructor
A new instance of Storage.
- #read_from_file ⇒ Object
- #write_to_file ⇒ Object
Constructor Details
#initialize(locale) ⇒ Storage
Returns a new instance of Storage.
4 5 6 |
# File 'lib/translate/storage.rb', line 4 def initialize(locale) self.locale = locale.to_sym end |
Instance Attribute Details
#locale ⇒ Object
Returns the value of attribute locale.
2 3 4 |
# File 'lib/translate/storage.rb', line 2 def locale @locale end |
Class Method Details
.file_paths(locale) ⇒ Object
16 17 18 |
# File 'lib/translate/storage.rb', line 16 def self.file_paths(locale) Dir.glob(File.join(root_dir, "config", "locales", "**","#{locale}.yml")) end |
.root_dir ⇒ Object
20 21 22 |
# File 'lib/translate/storage.rb', line 20 def self.root_dir Rails.root end |