Class: I18nAdmin::Translation
- Inherits:
-
Object
- Object
- I18nAdmin::Translation
- Includes:
- ActiveModel::Model
- Defined in:
- lib/i18n_admin/translation.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#original ⇒ Object
Returns the value of attribute original.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
7 8 9 |
# File 'lib/i18n_admin/translation.rb', line 7 def key @key end |
#locale ⇒ Object
Returns the value of attribute locale.
7 8 9 |
# File 'lib/i18n_admin/translation.rb', line 7 def locale @locale end |
#original ⇒ Object
Returns the value of attribute original.
7 8 9 |
# File 'lib/i18n_admin/translation.rb', line 7 def original @original end |
#value ⇒ Object
Returns the value of attribute value.
7 8 9 |
# File 'lib/i18n_admin/translation.rb', line 7 def value @value end |
Class Method Details
.key_from(encoded_key) ⇒ Object
23 24 25 |
# File 'lib/i18n_admin/translation.rb', line 23 def self.key_from(encoded_key) Base64.decode64(encoded_key) end |
Instance Method Details
#matches?(search) ⇒ Boolean
17 18 19 20 21 |
# File 'lib/i18n_admin/translation.rb', line 17 def matches?(search) [:key, :original, :value].any? do |key| send(key).to_s.match(search) end end |
#persisted? ⇒ Boolean
9 10 11 |
# File 'lib/i18n_admin/translation.rb', line 9 def persisted? true end |
#to_param ⇒ Object
13 14 15 |
# File 'lib/i18n_admin/translation.rb', line 13 def to_param Base64.strict_encode64(key) end |