class I18n::Backend::KeyValue::SubtreeProxy

Public Class Methods

# File lib/i18n/backend/key_value.rb, line 162
def initialize(master_key, store)
  @master_key = master_key
  @store = store
  @subtree = nil
end

Public Instance Methods

# File lib/i18n/backend/key_value.rb, line 172
def [](key)
  unless @subtree && value = @subtree[key]
    value = @store["#{@master_key}.#{key}"]
    if value
      value = JSON.decode(value)
      (@subtree ||= {})[key] = value
    end
  end
  value
end
# File lib/i18n/backend/key_value.rb, line 168
def has_key?(key)
  @subtree && @subtree.has_key?(key) || self[key]
end
# File lib/i18n/backend/key_value.rb, line 196
def inspect
  @subtree.inspect
end
Calls superclass method
# File lib/i18n/backend/key_value.rb, line 188
def instance_of?(klass)
  Hash == klass || super
end
Calls superclass method
# File lib/i18n/backend/key_value.rb, line 183
def is_a?(klass)
  Hash == klass || super
end
Also aliased as: kind_of?
# File lib/i18n/backend/key_value.rb, line 192
def nil?
  @subtree.nil?
end