Class: GoCardlessPro::Resources::NegativeBalanceLimit

Inherits:
Object
  • Object
show all
Defined in:
lib/gocardless_pro/resources/negative_balance_limit.rb

Overview

The negative balance limit is a threshold for the creditor balance beyond which refunds are not permitted. The default limit is zero — refunds are not permitted if the creditor has a negative balance. The limit can be changed on a per-creditor basis.

Defined Under Namespace

Classes: Links

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ NegativeBalanceLimit

Initialize a negative_balance_limit resource instance

Parameters:

  • object (Hash)

    an object returned from the API



23
24
25
26
27
28
29
30
31
32
# File 'lib/gocardless_pro/resources/negative_balance_limit.rb', line 23

def initialize(object, response = nil)
  @object = object

  @balance_limit = object['balance_limit']
  @created_at = object['created_at']
  @currency = object['currency']
  @id = object['id']
  @links = object['links']
  @response = response
end

Instance Attribute Details

#balance_limitObject (readonly)

Returns the value of attribute balance_limit.



19
20
21
# File 'lib/gocardless_pro/resources/negative_balance_limit.rb', line 19

def balance_limit
  @balance_limit
end

#created_atObject (readonly)

Returns the value of attribute created_at.



19
20
21
# File 'lib/gocardless_pro/resources/negative_balance_limit.rb', line 19

def created_at
  @created_at
end

#currencyObject (readonly)

Returns the value of attribute currency.



19
20
21
# File 'lib/gocardless_pro/resources/negative_balance_limit.rb', line 19

def currency
  @currency
end

#idObject (readonly)

Returns the value of attribute id.



19
20
21
# File 'lib/gocardless_pro/resources/negative_balance_limit.rb', line 19

def id
  @id
end

Instance Method Details

#api_responseObject



34
35
36
# File 'lib/gocardless_pro/resources/negative_balance_limit.rb', line 34

def api_response
  ApiResponse.new(@response)
end

Return the links that the resource has



39
40
41
# File 'lib/gocardless_pro/resources/negative_balance_limit.rb', line 39

def links
  @negative_balance_limit_links ||= Links.new(@links)
end

#to_hObject

Provides the negative_balance_limit resource as a hash of all its readable attributes



44
45
46
# File 'lib/gocardless_pro/resources/negative_balance_limit.rb', line 44

def to_h
  @object
end