Class: KB::Fake::ApiState

Inherits:
Object
  • Object
show all
Defined in:
lib/kb/fake/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(petparents: [], pets: [], consultations: [], petcontracts: [], plans: [], breeds: [], products: [], hubspot_relationship: [], referrals: []) ⇒ ApiState

rubocop:disable Metrics/ParameterLists



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/kb/fake/api.rb', line 15

def initialize(petparents: [], pets: [], consultations: [], petcontracts: [], plans: [], breeds: [],
               products: [], hubspot_relationship: [], referrals: [])
  @petparents = petparents
  @pets = pets
  @consultations = consultations
  @petcontracts = petcontracts
  @plans = plans
  @breeds = breeds
  @products = products
  @hubspot_relationship = hubspot_relationship
  @referrals = referrals
end

Instance Attribute Details

#breedsObject

Returns the value of attribute breeds.



11
12
13
# File 'lib/kb/fake/api.rb', line 11

def breeds
  @breeds
end

#consultationsObject

Returns the value of attribute consultations.



11
12
13
# File 'lib/kb/fake/api.rb', line 11

def consultations
  @consultations
end

#hubspot_relationshipObject

Returns the value of attribute hubspot_relationship.



11
12
13
# File 'lib/kb/fake/api.rb', line 11

def hubspot_relationship
  @hubspot_relationship
end

#petcontractsObject

Returns the value of attribute petcontracts.



11
12
13
# File 'lib/kb/fake/api.rb', line 11

def petcontracts
  @petcontracts
end

#petparentsObject

Returns the value of attribute petparents.



11
12
13
# File 'lib/kb/fake/api.rb', line 11

def petparents
  @petparents
end

#petsObject

Returns the value of attribute pets.



11
12
13
# File 'lib/kb/fake/api.rb', line 11

def pets
  @pets
end

#plansObject

Returns the value of attribute plans.



11
12
13
# File 'lib/kb/fake/api.rb', line 11

def plans
  @plans
end

#productsObject

Returns the value of attribute products.



11
12
13
# File 'lib/kb/fake/api.rb', line 11

def products
  @products
end

#referralsObject

Returns the value of attribute referrals.



11
12
13
# File 'lib/kb/fake/api.rb', line 11

def referrals
  @referrals
end

Instance Method Details

#to_snapshotObject

rubocop:enable Metrics/ParameterLists



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/kb/fake/api.rb', line 29

def to_snapshot
  {
    pets: @pets.clone,
    petparents: @petparents.clone,
    consultations: @consultations.clone,
    petcontracts: @petcontracts.clone,
    plans: @plans.clone,
    breeds: @breeds.clone,
    products: @products.clone,
    hubspot_relationship: @hubspot_relationship.clone,
    referrals: @referrals.clone
  }
end