Class: KB::Fake::Api

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BoundedContext::PetFamily::Pets

#stage

Class Method Details

.restore(snapshot) ⇒ Object



58
59
60
# File 'lib/kb/fake/api.rb', line 58

def self.restore(snapshot)
  set :state, ApiState.new(**snapshot)
end

.snapshotObject



54
55
56
# File 'lib/kb/fake/api.rb', line 54

def self.snapshot
  Api.state.to_snapshot
end

Instance Method Details

#resource_state(name) ⇒ Object



62
63
64
# File 'lib/kb/fake/api.rb', line 62

def resource_state(name)
  Api.state.send(name)
end

#set_resource_state(name, value) ⇒ Object



66
67
68
# File 'lib/kb/fake/api.rb', line 66

def set_resource_state(name, value)
  Api.state.send("#{name}=", value)
end