Class: Starling::Resources::DirectDebitMandateResource

Inherits:
BaseResource
  • Object
show all
Defined in:
lib/starling/resources/direct_debit_mandate_resource.rb

Overview

A resource representing a Direct Debit mandate returned from the Direct Debit Mandates API

Instance Method Summary collapse

Methods inherited from BaseResource

#initialize

Constructor Details

This class inherits a constructor from Starling::Resources::BaseResource

Instance Method Details

#createdTime Also known as: created_at

Returns the date when the mandate was created.

Returns:

  • (Time)

    the date when the mandate was created



27
28
29
# File 'lib/starling/resources/direct_debit_mandate_resource.rb', line 27

def created
  present_datetime(parsed_data['created'])
end

#originator_nameString

Returns the name of the Direct Debit mandate’s originator.

Returns:

  • (String)

    the name of the Direct Debit mandate’s originator



33
34
35
# File 'lib/starling/resources/direct_debit_mandate_resource.rb', line 33

def originator_name
  parsed_data['originatorName']
end

#originator_uidString

Returns the Starling internal ID of the Direct Debit mandate’s originator.

Returns:

  • (String)

    the Starling internal ID of the Direct Debit mandate’s originator



38
39
40
# File 'lib/starling/resources/direct_debit_mandate_resource.rb', line 38

def originator_uid
  parsed_data['originatorUid']
end

#referenceString

Returns the reference of the Direct Debit mandate.

Returns:

  • (String)

    the reference of the Direct Debit mandate



12
13
14
# File 'lib/starling/resources/direct_debit_mandate_resource.rb', line 12

def reference
  parsed_data['reference']
end

#sourceSymbol

Returns the source of the mandate (e.g. ‘:electronic` or `paper).

Returns:

  • (Symbol)

    the source of the mandate (e.g. ‘:electronic` or `paper)



22
23
24
# File 'lib/starling/resources/direct_debit_mandate_resource.rb', line 22

def source
  present_enum(parsed_data['source'])
end

#statusSymbol

Returns the status of the mandate (e.g. ‘:live`).

Returns:

  • (Symbol)

    the status of the mandate (e.g. ‘:live`)



17
18
19
# File 'lib/starling/resources/direct_debit_mandate_resource.rb', line 17

def status
  present_enum(parsed_data['status'])
end

#uidString

Returns the Starling internal ID of the Direct Debit mandate.

Returns:

  • (String)

    the Starling internal ID of the Direct Debit mandate



7
8
9
# File 'lib/starling/resources/direct_debit_mandate_resource.rb', line 7

def uid
  parsed_data['uid']
end