Class: RSpecStripe::Runner
- Inherits:
-
Object
- Object
- RSpecStripe::Runner
- Defined in:
- lib/rspec-stripe/runner.rb
Instance Attribute Summary collapse
-
#card ⇒ Object
Returns the value of attribute card.
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#plan ⇒ Object
Returns the value of attribute plan.
-
#recipes ⇒ Object
Returns the value of attribute recipes.
-
#subscription ⇒ Object
Returns the value of attribute subscription.
Instance Method Summary collapse
- #call! ⇒ Object
- #cleanup! ⇒ Object
-
#initialize(recipes) ⇒ Runner
constructor
A new instance of Runner.
Constructor Details
#initialize(recipes) ⇒ Runner
Returns a new instance of Runner.
5 6 7 |
# File 'lib/rspec-stripe/runner.rb', line 5 def initialize(recipes) @recipes = recipes end |
Instance Attribute Details
#card ⇒ Object
Returns the value of attribute card.
3 4 5 |
# File 'lib/rspec-stripe/runner.rb', line 3 def card @card end |
#customer ⇒ Object
Returns the value of attribute customer.
3 4 5 |
# File 'lib/rspec-stripe/runner.rb', line 3 def customer @customer end |
#plan ⇒ Object
Returns the value of attribute plan.
3 4 5 |
# File 'lib/rspec-stripe/runner.rb', line 3 def plan @plan end |
#recipes ⇒ Object
Returns the value of attribute recipes.
3 4 5 |
# File 'lib/rspec-stripe/runner.rb', line 3 def recipes @recipes end |
#subscription ⇒ Object
Returns the value of attribute subscription.
3 4 5 |
# File 'lib/rspec-stripe/runner.rb', line 3 def subscription @subscription end |
Instance Method Details
#call! ⇒ Object
9 10 11 12 13 14 |
# File 'lib/rspec-stripe/runner.rb', line 9 def call! @customer = customer_factory.get if recipes[:customer] @plan = plan_factory.get if recipes[:plan] @card = card_factory.get if recipes[:card] @subscription = subscription_factory.get if recipes[:subscription] end |
#cleanup! ⇒ Object
16 17 18 19 20 |
# File 'lib/rspec-stripe/runner.rb', line 16 def cleanup! factories.reject(&:nil?).each do |factory| factory.cleanup end end |