class Translatable::ActiveRecord::Attributes
Public Instance Methods
[](locale)
click to toggle source
# File lib/translatable/active_record/attributes.rb, line 7 def [](locale) locale = locale.to_sym self[locale] = {} unless has_key?(locale) self.fetch(locale) end
contains?(locale, name)
click to toggle source
# File lib/translatable/active_record/attributes.rb, line 13 def contains?(locale, name) self[locale].has_key?(name.to_s) end
read(locale, name)
click to toggle source
# File lib/translatable/active_record/attributes.rb, line 17 def read(locale, name) self[locale][name.to_s] end
write(locale, name, value)
click to toggle source
# File lib/translatable/active_record/attributes.rb, line 21 def write(locale, name, value) #raise 'z' if value.nil? # TODO self[locale][name.to_s] = value end