Sha256: e2855926e07d2e88917426c855669d561ab155a59e29996d1b1b3a6e88a45422
Contents?: true
Size: 1016 Bytes
Versions: 14
Compression:
Stored size: 1016 Bytes
Contents
class PeakFlowUtils::HandlerText < PeakFlowUtils::ApplicationRecord belongs_to :group belongs_to :handler belongs_to :translation_key validates :handler, :translation_key, presence: true delegate :key, :last_key, to: :translation_key delegate :value, to: :translation, prefix: true delegate :array_translation?, :file_line_content, :file_line_content?, :translated_value_for_locale, to: :translation def key_show_with_fallback key_show.presence || last_key end def translation @translation ||= PeakFlowUtils::Translation.new( key: key, dir: dir, full_path: full_path, file_path: file_path, line_no: line_no ) end def finished? @_finished = translation.finished? if @finished.nil? @_finished end def unfinished? !finished? end def array_key return unless (match = key.match(/\A(.+)\[(\d+)\]\Z/)) match[1] end def array_no return unless (match = key.match(/\A(.+)\[(\d+)\]\Z/)) match[2].to_i end end
Version data entries
14 entries across 14 versions & 1 rubygems