Class: Starling::Resources::CardResource
- Inherits:
-
BaseResource
- Object
- BaseResource
- Starling::Resources::CardResource
- Defined in:
- lib/starling/resources/card_resource.rb
Overview
A resource representing a response from the Card API
Instance Method Summary collapse
-
#activated ⇒ true, false
Whether the card has been activated.
-
#activation_requested ⇒ true, false
Whether the card’s activation has been requested.
-
#cancelled ⇒ true, false
Whether the card has been cancelled.
-
#dispatch_date ⇒ Date
When the card was dispatched by post to the user.
-
#enabled ⇒ true, false
Whether the card is enabled.
-
#id ⇒ String
The Starling internal ID of the card.
-
#name_on_card ⇒ String
The name on the front of the card.
-
#type ⇒ String
The type of the card (e.g. “ContactlessDebitMastercard”).
Methods inherited from BaseResource
Constructor Details
This class inherits a constructor from Starling::Resources::BaseResource
Instance Method Details
#activated ⇒ true, false
Returns 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_requested ⇒ true, false
Returns 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 |
#cancelled ⇒ true, false
Returns 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_date ⇒ Date
Returns 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 |
#enabled ⇒ true, false
Returns whether the card is enabled.
21 22 23 |
# File 'lib/starling/resources/card_resource.rb', line 21 def enabled parsed_data['enabled'] end |
#id ⇒ String
Returns 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_card ⇒ String
Returns 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 |
#type ⇒ String
Returns 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 |