Exception: Localite::Translate::Missing

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/localite/translate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Missing

Returns a new instance of Missing.



81
82
83
84
85
# File 'lib/localite/translate.rb', line 81

def initialize(opts)
  @locale, @string = *opts
  @scope = Localite.current_scope.to_s
  # dlog "--> scope", @scope.inspect
end

Instance Attribute Details

#localeObject (readonly)

Returns the value of attribute locale.



79
80
81
# File 'lib/localite/translate.rb', line 79

def locale
  @locale
end

#scopeObject (readonly)

Returns the value of attribute scope.



79
80
81
# File 'lib/localite/translate.rb', line 79

def scope
  @scope
end

#stringObject (readonly)

Returns the value of attribute string.



79
80
81
# File 'lib/localite/translate.rb', line 79

def string
  @string
end

Instance Method Details

#to_sObject



87
88
89
# File 'lib/localite/translate.rb', line 87

def to_s
  "Missing translation: [#{locale}] #{string.inspect} (in scope #{scope.inspect})"
end