Class: KB::Fake::Api
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- KB::Fake::Api
- Includes:
- BoundedContext::PetFamily::Breeds, 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
53 54 55 |
# File 'lib/kb/fake/api.rb', line 53 def self.restore(snapshot) set :state, ApiState.new(**snapshot) end |
.snapshot ⇒ Object
49 50 51 |
# File 'lib/kb/fake/api.rb', line 49 def self.snapshot Api.state.to_snapshot end |
Instance Method Details
#resource_state(name) ⇒ Object
57 58 59 |
# File 'lib/kb/fake/api.rb', line 57 def resource_state(name) Api.state.send(name) end |
#set_resource_state(name, value) ⇒ Object
61 62 63 |
# File 'lib/kb/fake/api.rb', line 61 def set_resource_state(name, value) Api.state.send("#{name}=", value) end |