Class: Starling::Resources::CardResource

Inherits:
BaseResource show all
Defined in:
lib/starling/resources/card_resource.rb

Overview

A resource representing a response from the Card API

Instance Method Summary collapse

Methods inherited from BaseResource

#initialize

Constructor Details

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

Instance Method Details

#activatedtrue, false

Returns whether the card has been activated.

Returns:

  • (true, false)

    whether the card has been activated


36
37
38
# File 'lib/starling/resources/card_resource.rb', line 36

def activated
  parsed_data['activated']
end

#activation_requestedtrue, false

Returns whether the card's activation has been requested.

Returns:

  • (true, false)

    whether the card's activation has been requested


31
32
33
# File 'lib/starling/resources/card_resource.rb', line 31

def activation_requested
  parsed_data['activationRequested']
end

#cancelledtrue, false

Returns whether the card has been cancelled.

Returns:

  • (true, false)

    whether the card has been cancelled


26
27
28
# File 'lib/starling/resources/card_resource.rb', line 26

def cancelled
  parsed_data['cancelled']
end

#dispatch_dateDate

Returns when the card was dispatched by post to the user.

Returns:

  • (Date)

    when the card was dispatched by post to the user


41
42
43
# File 'lib/starling/resources/card_resource.rb', line 41

def dispatch_date
  present_date(parsed_data['dispatchDate'])
end

#enabledtrue, false

Returns whether the card is enabled.

Returns:

  • (true, false)

    whether the card is enabled


21
22
23
# File 'lib/starling/resources/card_resource.rb', line 21

def enabled
  parsed_data['enabled']
end

#idString

Returns the Starling internal ID of the card.

Returns:

  • (String)

    the Starling internal ID of the card


6
7
8
# File 'lib/starling/resources/card_resource.rb', line 6

def id
  parsed_data['id']
end

#name_on_cardString

Returns the name on the front of the card.

Returns:

  • (String)

    the name on the front of the card


11
12
13
# File 'lib/starling/resources/card_resource.rb', line 11

def name_on_card
  parsed_data['nameOnCard']
end

#typeString

Returns the type of the card (e.g. “ContactlessDebitMastercard”).

Returns:

  • (String)

    the type of the card (e.g. “ContactlessDebitMastercard”)


16
17
18
# File 'lib/starling/resources/card_resource.rb', line 16

def type
  parsed_data['type']
end