class Countrizable::ActiveRecord::Attributes
Public Instance Methods
[](country_code)
click to toggle source
# File lib/countrizable/active_record/attributes.rb, line 7 def [](country_code) country_code = country_code.to_sym self[country_code] = {} unless has_key?(country_code) self.fetch(country_code) end
contains?(country_code, name)
click to toggle source
# File lib/countrizable/active_record/attributes.rb, line 13 def contains?(country_code, name) self[country_code].has_key?(name.to_s) end
read(country_code, name)
click to toggle source
# File lib/countrizable/active_record/attributes.rb, line 17 def read(country_code, name) self[country_code][name.to_s] end
write(country_code, name, value)
click to toggle source
# File lib/countrizable/active_record/attributes.rb, line 21 def write(country_code, name, value) self[country_code][name.to_s] = value end