Class: ProcessOut::Card
- Inherits:
-
Object
- Object
- ProcessOut::Card
- Defined in:
- lib/processout/card.rb
Instance Attribute Summary collapse
-
#bank_name ⇒ Object
Returns the value of attribute bank_name.
-
#brand ⇒ Object
Returns the value of attribute brand.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#exp_month ⇒ Object
Returns the value of attribute exp_month.
-
#exp_year ⇒ Object
Returns the value of attribute exp_year.
-
#id ⇒ Object
Returns the value of attribute id.
-
#iin ⇒ Object
Returns the value of attribute iin.
-
#last_4_digits ⇒ Object
Returns the value of attribute last_4_digits.
-
#level ⇒ Object
Returns the value of attribute level.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#project ⇒ Object
Returns the value of attribute project.
-
#sandbox ⇒ Object
Returns the value of attribute sandbox.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#fill_with_data(data) ⇒ Object
- Fills the object with data coming from the API Params:
data -
Hashof data coming from the API.
- Fills the object with data coming from the API Params:
-
#initialize(client) ⇒ Card
constructor
- Initializes the Card object Params:
client -
ProcessOutclient instance.
- Initializes the Card object Params:
Constructor Details
#initialize(client) ⇒ Card
Initializes the Card object Params:
client-
ProcessOutclient instance
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/processout/card.rb', line 88 def initialize(client) @client = client @id = "" @project = nil @brand = "" @type = "" @bank_name = "" @level = "" @iin = "" @last_4_digits = "" @exp_month = 0 @exp_year = 0 = Hash.new @sandbox = false @created_at = "" end |
Instance Attribute Details
#bank_name ⇒ Object
Returns the value of attribute bank_name.
14 15 16 |
# File 'lib/processout/card.rb', line 14 def bank_name @bank_name end |
#brand ⇒ Object
Returns the value of attribute brand.
12 13 14 |
# File 'lib/processout/card.rb', line 12 def brand @brand end |
#created_at ⇒ Object
Returns the value of attribute created_at.
22 23 24 |
# File 'lib/processout/card.rb', line 22 def created_at @created_at end |
#exp_month ⇒ Object
Returns the value of attribute exp_month.
18 19 20 |
# File 'lib/processout/card.rb', line 18 def exp_month @exp_month end |
#exp_year ⇒ Object
Returns the value of attribute exp_year.
19 20 21 |
# File 'lib/processout/card.rb', line 19 def exp_year @exp_year end |
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/processout/card.rb', line 10 def id @id end |
#iin ⇒ Object
Returns the value of attribute iin.
16 17 18 |
# File 'lib/processout/card.rb', line 16 def iin @iin end |
#last_4_digits ⇒ Object
Returns the value of attribute last_4_digits.
17 18 19 |
# File 'lib/processout/card.rb', line 17 def last_4_digits @last_4_digits end |
#level ⇒ Object
Returns the value of attribute level.
15 16 17 |
# File 'lib/processout/card.rb', line 15 def level @level end |
#metadata ⇒ Object
Returns the value of attribute metadata.
20 21 22 |
# File 'lib/processout/card.rb', line 20 def end |
#project ⇒ Object
Returns the value of attribute project.
11 12 13 |
# File 'lib/processout/card.rb', line 11 def project @project end |
#sandbox ⇒ Object
Returns the value of attribute sandbox.
21 22 23 |
# File 'lib/processout/card.rb', line 21 def sandbox @sandbox end |
#type ⇒ Object
Returns the value of attribute type.
13 14 15 |
# File 'lib/processout/card.rb', line 13 def type @type end |
Instance Method Details
#fill_with_data(data) ⇒ Object
Fills the object with data coming from the API Params:
data-
Hashof data coming from the API
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/processout/card.rb', line 110 def fill_with_data(data) if data.include? "id" @id = data["id"] end if data.include? "project" @project = data["project"] end if data.include? "brand" @brand = data["brand"] end if data.include? "type" @type = data["type"] end if data.include? "bank_name" @bank_name = data["bank_name"] end if data.include? "level" @level = data["level"] end if data.include? "iin" @iin = data["iin"] end if data.include? "last_4_digits" @last_4_digits = data["last_4_digits"] end if data.include? "exp_month" @exp_month = data["exp_month"] end if data.include? "exp_year" @exp_year = data["exp_year"] end if data.include? "metadata" = data["metadata"] end if data.include? "sandbox" @sandbox = data["sandbox"] end if data.include? "created_at" @created_at = data["created_at"] end self end |