Class: AwesomeTranslations::CacheDatabaseGenerator::HandlerTranslation
- Inherits:
-
BazaModels::Model
- Object
- BazaModels::Model
- AwesomeTranslations::CacheDatabaseGenerator::HandlerTranslation
- Defined in:
- lib/awesome_translations/cache_database_generator/handler_translation.rb
Instance Method Summary collapse
- #array_key ⇒ Object
- #array_no ⇒ Object
- #finished? ⇒ Boolean
- #key_show_with_fallback ⇒ Object
- #translation ⇒ Object
- #unfinished? ⇒ Boolean
Instance Method Details
#array_key ⇒ Object
43 44 45 46 47 |
# File 'lib/awesome_translations/cache_database_generator/handler_translation.rb', line 43 def array_key return unless (match = key.match(/\A(.+)\[(\d+)\]\Z/)) match[1] end |
#array_no ⇒ Object
49 50 51 52 53 |
# File 'lib/awesome_translations/cache_database_generator/handler_translation.rb', line 49 def array_no return unless (match = key.match(/\A(.+)\[(\d+)\]\Z/)) match[2].to_i end |
#finished? ⇒ Boolean
34 35 36 37 |
# File 'lib/awesome_translations/cache_database_generator/handler_translation.rb', line 34 def finished? @_finished = translation.finished? if @finished.nil? @_finished end |
#key_show_with_fallback ⇒ Object
20 21 22 |
# File 'lib/awesome_translations/cache_database_generator/handler_translation.rb', line 20 def key_show_with_fallback key_show.presence || last_key end |
#translation ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/awesome_translations/cache_database_generator/handler_translation.rb', line 24 def translation @translation ||= AwesomeTranslations::Translation.new( key: key, dir: dir, full_path: full_path, file_path: file_path, line_no: line_no ) end |
#unfinished? ⇒ Boolean
39 40 41 |
# File 'lib/awesome_translations/cache_database_generator/handler_translation.rb', line 39 def unfinished? !finished? end |