Class: I18nJsAssets::Entry
- Inherits:
-
Object
- Object
- I18nJsAssets::Entry
- Defined in:
- lib/i18n-js-assets/entry.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#source_path ⇒ Object
readonly
Returns the value of attribute source_path.
-
#target_path ⇒ Object
readonly
Returns the value of attribute target_path.
Instance Method Summary collapse
- #apply! ⇒ Object
-
#initialize(app, source_path, target_path, options) ⇒ Entry
constructor
A new instance of Entry.
Constructor Details
#initialize(app, source_path, target_path, options) ⇒ Entry
Returns a new instance of Entry.
9 10 11 12 13 14 |
# File 'lib/i18n-js-assets/entry.rb', line 9 def initialize(app, source_path, target_path, ) @app = app @source_path = source_path @target_path = target_path = end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
7 8 9 |
# File 'lib/i18n-js-assets/entry.rb', line 7 def app @app end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/i18n-js-assets/entry.rb', line 7 def end |
#source_path ⇒ Object (readonly)
Returns the value of attribute source_path.
7 8 9 |
# File 'lib/i18n-js-assets/entry.rb', line 7 def source_path @source_path end |
#target_path ⇒ Object (readonly)
Returns the value of attribute target_path.
7 8 9 |
# File 'lib/i18n-js-assets/entry.rb', line 7 def target_path @target_path end |
Instance Method Details
#apply! ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/i18n-js-assets/entry.rb', line 16 def apply! each_file do |locale, interpolated_target_path| path = "#{interpolated_target_path}.i18njs" app.config.assets.generated.add(path, ) do source.overwrite('locales' => [locale]).dump end end end |