Class: GoCardless::Subscription

Inherits:
Resource
  • Object
show all
Defined in:
lib/gocardless/subscription.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#id, #uri

Instance Method Summary collapse

Methods inherited from Resource

creatable, creatable?, date_accessor, date_writer, find, find_with_client, #initialize, #inspect, new_with_client, #persisted?, reference_accessor, reference_reader, reference_writer, #save, #to_hash, #to_json, updatable, updatable?

Constructor Details

This class inherits a constructor from GoCardless::Resource

Instance Attribute Details

#amount ⇒ Object

Returns the value of attribute amount.



6
7
8
# File 'lib/gocardless/subscription.rb', line 6

def amount
  @amount
end

#currency ⇒ Object

Returns the value of attribute currency.



6
7
8
# File 'lib/gocardless/subscription.rb', line 6

def currency
  @currency
end

#description ⇒ Object

Returns the value of attribute description.



6
7
8
# File 'lib/gocardless/subscription.rb', line 6

def description
  @description
end

#interval_length ⇒ Object

Returns the value of attribute interval_length.



6
7
8
# File 'lib/gocardless/subscription.rb', line 6

def interval_length
  @interval_length
end

#interval_unit ⇒ Object

Returns the value of attribute interval_unit.



6
7
8
# File 'lib/gocardless/subscription.rb', line 6

def interval_unit
  @interval_unit
end

#name ⇒ Object

Returns the value of attribute name.



6
7
8
# File 'lib/gocardless/subscription.rb', line 6

def name
  @name
end

#next_interval_start ⇒ Object

Returns the value of attribute next_interval_start.



6
7
8
# File 'lib/gocardless/subscription.rb', line 6

def next_interval_start
  @next_interval_start
end

#plan_id ⇒ Object

Returns the value of attribute plan_id.



6
7
8
# File 'lib/gocardless/subscription.rb', line 6

def plan_id
  @plan_id
end

#setup_fee ⇒ Object

Returns the value of attribute setup_fee.



6
7
8
# File 'lib/gocardless/subscription.rb', line 6

def setup_fee
  @setup_fee
end

#status ⇒ Object

Returns the value of attribute status.



6
7
8
# File 'lib/gocardless/subscription.rb', line 6

def status
  @status
end

#trial_length ⇒ Object

Returns the value of attribute trial_length.



6
7
8
# File 'lib/gocardless/subscription.rb', line 6

def trial_length
  @trial_length
end

#trial_unit ⇒ Object

Returns the value of attribute trial_unit.



6
7
8
# File 'lib/gocardless/subscription.rb', line 6

def trial_unit
  @trial_unit
end

Instance Method Details

#cancel! ⇒ Object



24
25
26
27
# File 'lib/gocardless/subscription.rb', line 24

def cancel!
  path = self.class.endpoint.gsub(':id', id.to_s) + '/cancel'
  client.api_put(path)
end