Class: Raas::GetDepositResponseModel
- Defined in:
- lib/raas/models/get_deposit_response_model.rb
Overview
Represents the response from a get deposit call
Instance Attribute Summary collapse
-
#amount ⇒ Float
The deposit amount.
-
#amount_charged ⇒ Float
The amount charged.
-
#created_date ⇒ DateTime
The date the deposit was made.
-
#fee_percent ⇒ Float
The fee percentage.
-
#reference_deposit_id ⇒ String
The deposit reference id.
-
#status ⇒ String
The deposit’s status.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(amount = nil, amount_charged = nil, created_date = nil, fee_percent = nil, reference_deposit_id = nil, status = nil) ⇒ GetDepositResponseModel
constructor
A new instance of GetDepositResponseModel.
Methods inherited from BaseModel
Constructor Details
#initialize(amount = nil, amount_charged = nil, created_date = nil, fee_percent = nil, reference_deposit_id = nil, status = nil) ⇒ GetDepositResponseModel
Returns a new instance of GetDepositResponseModel.
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/raas/models/get_deposit_response_model.rb', line 44 def initialize(amount = nil, amount_charged = nil, created_date = nil, fee_percent = nil, reference_deposit_id = nil, status = nil) @amount = amount @amount_charged = amount_charged @created_date = created_date @fee_percent = fee_percent @reference_deposit_id = reference_deposit_id @status = status end |
Instance Attribute Details
#amount ⇒ Float
The deposit amount
10 11 12 |
# File 'lib/raas/models/get_deposit_response_model.rb', line 10 def amount @amount end |
#amount_charged ⇒ Float
The amount charged
14 15 16 |
# File 'lib/raas/models/get_deposit_response_model.rb', line 14 def amount_charged @amount_charged end |
#created_date ⇒ DateTime
The date the deposit was made
18 19 20 |
# File 'lib/raas/models/get_deposit_response_model.rb', line 18 def created_date @created_date end |
#fee_percent ⇒ Float
The fee percentage
22 23 24 |
# File 'lib/raas/models/get_deposit_response_model.rb', line 22 def fee_percent @fee_percent end |
#reference_deposit_id ⇒ String
The deposit reference id
26 27 28 |
# File 'lib/raas/models/get_deposit_response_model.rb', line 26 def reference_deposit_id @reference_deposit_id end |
#status ⇒ String
The deposit’s status
30 31 32 |
# File 'lib/raas/models/get_deposit_response_model.rb', line 30 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/raas/models/get_deposit_response_model.rb', line 59 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. amount = hash['amount'] amount_charged = hash['amountCharged'] created_date = APIHelper.rfc3339(hash['createdDate']) if hash['createdDate'] fee_percent = hash['feePercent'] reference_deposit_id = hash['referenceDepositID'] status = hash['status'] # Create object from extracted values. GetDepositResponseModel.new(amount, amount_charged, created_date, fee_percent, reference_deposit_id, status) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/raas/models/get_deposit_response_model.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['amount'] = 'amount' @_hash['amount_charged'] = 'amountCharged' @_hash['created_date'] = 'createdDate' @_hash['fee_percent'] = 'feePercent' @_hash['reference_deposit_id'] = 'referenceDepositID' @_hash['status'] = 'status' @_hash end |