Class: FakeBraintree::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/fake_braintree/registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRegistry

Returns a new instance of Registry.



2
3
4
# File 'lib/fake_braintree/registry.rb', line 2

def initialize
  clear!
end

Instance Attribute Details

#addressesObject

Returns the value of attribute addresses.



6
7
8
# File 'lib/fake_braintree/registry.rb', line 6

def addresses
  @addresses
end

#credit_cardsObject

Returns the value of attribute credit_cards.



6
7
8
# File 'lib/fake_braintree/registry.rb', line 6

def credit_cards
  @credit_cards
end

#customersObject

Returns the value of attribute customers.



6
7
8
# File 'lib/fake_braintree/registry.rb', line 6

def customers
  @customers
end

#failuresObject

Returns the value of attribute failures.



6
7
8
# File 'lib/fake_braintree/registry.rb', line 6

def failures
  @failures
end

#redirectsObject

Returns the value of attribute redirects.



6
7
8
# File 'lib/fake_braintree/registry.rb', line 6

def redirects
  @redirects
end

#subscriptionsObject

Returns the value of attribute subscriptions.



6
7
8
# File 'lib/fake_braintree/registry.rb', line 6

def subscriptions
  @subscriptions
end

#transactionsObject

Returns the value of attribute transactions.



6
7
8
# File 'lib/fake_braintree/registry.rb', line 6

def transactions
  @transactions
end

Instance Method Details

#clear!Object



9
10
11
12
13
14
15
16
17
# File 'lib/fake_braintree/registry.rb', line 9

def clear!
  @addresses     = {}
  @customers     = {}
  @subscriptions = {}
  @failures      = {}
  @transactions  = {}
  @redirects     = {}
  @credit_cards  = {}
end

#failure?(card_number) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/fake_braintree/registry.rb', line 19

def failure?(card_number)
  @failures.keys.include?(card_number)
end