class DpStmMap::ObjectTransactionWrapper

Public Class Methods

new(tx) click to toggle source
# File lib/dp_stm_map/ObjectStore.rb, line 19
def initialize tx
  @tx=tx
end

Public Instance Methods

[](domain, key) click to toggle source
# File lib/dp_stm_map/ObjectStore.rb, line 27
def [] domain, key
  raw=@tx[domain_key(domain,key)]
  if (raw == nil)
    nil
  else
    YAML::load(raw)
  end
end
[]=(domain, key, value) click to toggle source
# File lib/dp_stm_map/ObjectStore.rb, line 23
def []= domain, key, value
  @tx[domain_key(domain,key)]=value == nil ? nil : YAML::dump(value)
end
domain_key(domain, key) click to toggle source
# File lib/dp_stm_map/ObjectStore.rb, line 40
def domain_key domain, key
  "%s:%s" % [domain.to_s, key.to_s]
end
has_key?(domain, key) click to toggle source
# File lib/dp_stm_map/ObjectStore.rb, line 36
def has_key? domain, key
  @tx.has_key?(domain_key(domain,key))
end