class Ethereum::DB::EphemDB
Public Class Methods
new()
click to toggle source
# File lib/ethereum/db/ephem_db.rb, line 7 def initialize @db = {} end
Public Instance Methods
==(other)
click to toggle source
# File lib/ethereum/db/ephem_db.rb, line 36 def ==(other) other.instance_of?(self.class) && db == other.db end
cleanup(epoch)
click to toggle source
# File lib/ethereum/db/ephem_db.rb, line 56 def cleanup(epoch) # do nothing end
commit()
click to toggle source
# File lib/ethereum/db/ephem_db.rb, line 27 def commit # do nothing end
commit_refcount_changes(epoch)
click to toggle source
# File lib/ethereum/db/ephem_db.rb, line 52 def commit_refcount_changes(epoch) # do nothing end
dec_refcount(k)
click to toggle source
# File lib/ethereum/db/ephem_db.rb, line 44 def dec_refcount(k) # do nothing end
delete(k)
click to toggle source
# File lib/ethereum/db/ephem_db.rb, line 23 def delete(k) @db.delete(k) end
get(k)
click to toggle source
# File lib/ethereum/db/ephem_db.rb, line 11 def get(k) if has_key?(k) @db[k] else raise KeyError, k.inspect end end
has_key?(k)
click to toggle source
# File lib/ethereum/db/ephem_db.rb, line 31 def has_key?(k) @db.has_key?(k) end
Also aliased as: include?
inc_refcount(k, v)
click to toggle source
# File lib/ethereum/db/ephem_db.rb, line 40 def inc_refcount(k, v) put k, v end
put(k, v)
click to toggle source
# File lib/ethereum/db/ephem_db.rb, line 19 def put(k, v) @db[k] = v end
put_temporarily(k, v)
click to toggle source
# File lib/ethereum/db/ephem_db.rb, line 60 def put_temporarily(k, v) inc_refcount(k, v) dec_refcount(k) end
revert_refcount_changes(epoch)
click to toggle source
# File lib/ethereum/db/ephem_db.rb, line 48 def revert_refcount_changes(epoch) # do nothing end