1
0
mirror of https://github.com/cmur2/dyndnsd.git synced 2024-12-22 20:54:24 +01:00
dyndnsd/spec/support/dummy_database.rb

28 lines
380 B
Ruby
Raw Normal View History

2013-04-27 14:07:14 +02:00
require 'forwardable'
module Dyndnsd
class DummyDatabase
extend Forwardable
2018-02-23 12:54:43 +01:00
2013-04-27 14:07:14 +02:00
def_delegators :@db, :[], :[]=, :each, :has_key?
def initialize(db_init)
@db_init = db_init
end
def load
@db = @db_init
@db_hash = @db.hash
end
def save
@db_hash = @db.hash
end
def changed?
@db_hash != @db.hash
end
end
end