Class: KB::Fake::Api
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- KB::Fake::Api
- Includes:
- BoundedContext::PetFamily::Breeds, BoundedContext::PetFamily::HubspotRelationship, BoundedContext::PetFamily::PetContracts, BoundedContext::PetFamily::PetParents, BoundedContext::PetFamily::Pets, BoundedContext::PetFamily::Products
- Defined in:
- lib/kb/fake/api.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from BoundedContext::PetFamily::Pets
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 |
.snapshot ⇒ Object
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 |