Class: GoCardlessPro::Resources::Export

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

Overview

File-based exports of data

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ Export

Initialize a export resource instance

Parameters:

  • object (Hash)

    an object returned from the API



19
20
21
22
23
24
25
26
27
28
# File 'lib/gocardless_pro/resources/export.rb', line 19

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

  @created_at = object['created_at']
  @currency = object['currency']
  @download_url = object['download_url']
  @export_type = object['export_type']
  @id = object['id']
  @response = response
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



15
16
17
# File 'lib/gocardless_pro/resources/export.rb', line 15

def created_at
  @created_at
end

#currencyObject (readonly)

Returns the value of attribute currency.



15
16
17
# File 'lib/gocardless_pro/resources/export.rb', line 15

def currency
  @currency
end

#download_urlObject (readonly)

Returns the value of attribute download_url.



15
16
17
# File 'lib/gocardless_pro/resources/export.rb', line 15

def download_url
  @download_url
end

#export_typeObject (readonly)

Returns the value of attribute export_type.



15
16
17
# File 'lib/gocardless_pro/resources/export.rb', line 15

def export_type
  @export_type
end

#idObject (readonly)

Returns the value of attribute id.



15
16
17
# File 'lib/gocardless_pro/resources/export.rb', line 15

def id
  @id
end

Instance Method Details

#api_responseObject



30
31
32
# File 'lib/gocardless_pro/resources/export.rb', line 30

def api_response
  ApiResponse.new(@response)
end

#to_hObject

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



35
36
37
# File 'lib/gocardless_pro/resources/export.rb', line 35

def to_h
  @object
end