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



21
22
23
24
25
26
27
# File 'lib/gocardless_pro/resources/mandate_pdf.rb', line 21

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.



17
18
19
# File 'lib/gocardless_pro/resources/mandate_pdf.rb', line 17

def expires_at
  @expires_at
end

#urlObject (readonly)

Returns the value of attribute url.



17
18
19
# File 'lib/gocardless_pro/resources/mandate_pdf.rb', line 17

def url
  @url
end

Instance Method Details

#api_responseObject



29
30
31
# File 'lib/gocardless_pro/resources/mandate_pdf.rb', line 29

def api_response
  ApiResponse.new(@response)
end

#to_hObject

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



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

def to_h
  @object
end