module Moneta::Xattr::Implementation

Public Instance Methods

[](key) click to toggle source
# File lib/moneta/xattr.rb, line 32
def [](key)
  return nil unless key?(key)
  Marshal.load(@hash.get(key))
end
[]=(key, value) click to toggle source
# File lib/moneta/xattr.rb, line 37
def []=(key, value)
  @hash.set(key, Marshal.dump(value))
end
clear() click to toggle source
# File lib/moneta/xattr.rb, line 48
def clear
  @hash.list.each do |item|
    @hash.remove(item)
  end
end
delete(key) click to toggle source
# File lib/moneta/xattr.rb, line 41
def delete(key)
  return nil unless key?(key)
  value = self[key]
  @hash.remove(key)
  value
end
has_key?(key)
Alias for: key?
key?(key) click to toggle source
# File lib/moneta/xattr.rb, line 26
def key?(key)
  @hash.list.include?(key)
end
Also aliased as: has_key?