Class: GoCardlessPro::Resources::MandatePdf

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

Overview

Mandate PDFs allow you to easily display [scheme-rules compliant](#appendix-compliance-requirements) Direct Debit mandates to your customers.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ MandatePdf

Initialize a mandate_pdf resource instance

Parameters:

  • object (Hash)

    an object returned from the API



24
25
26
27
28
29
30
# File 'lib/gocardless_pro/resources/mandate_pdf.rb', line 24

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

  @expires_at = object['expires_at']
  @url = object['url']
  @response = response
end

Instance Attribute Details

#expires_atObject (readonly)

Returns the value of attribute expires_at.



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

def expires_at
  @expires_at
end

#urlObject (readonly)

Returns the value of attribute url.



20
21
22
# File 'lib/gocardless_pro/resources/mandate_pdf.rb', line 20

def url
  @url
end

Instance Method Details

#api_responseObject



32
33
34
# File 'lib/gocardless_pro/resources/mandate_pdf.rb', line 32

def api_response
  ApiResponse.new(@response)
end

#to_hObject

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



37
38
39
# File 'lib/gocardless_pro/resources/mandate_pdf.rb', line 37

def to_h
  @object
end