Class: RSpecStripe::Factory::Subscription

Inherits:
Struct
  • Object
show all
Defined in:
lib/rspec-stripe/factories/subscription.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#customerObject

Returns the value of attribute customer

Returns:

  • (Object)

    the current value of customer



2
3
4
# File 'lib/rspec-stripe/factories/subscription.rb', line 2

def customer
  @customer
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



2
3
4
# File 'lib/rspec-stripe/factories/subscription.rb', line 2

def id
  @id
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



2
3
4
# File 'lib/rspec-stripe/factories/subscription.rb', line 2

def 
  @metadata
end

Instance Method Details

#cleanupObject



9
10
11
# File 'lib/rspec-stripe/factories/subscription.rb', line 9

def cleanup
  get.delete
end

#getObject



3
4
5
6
7
# File 'lib/rspec-stripe/factories/subscription.rb', line 3

def get
  @get ||= begin
    customer.subscriptions.create(plan: id, metadata: )
  end
end