Class: Raas::AccountSummaryModel
- Defined in:
- lib/raas/models/account_summary_model.rb
Overview
Represents an Account Summary
Instance Attribute Summary collapse
-
#account_identifier ⇒ String
The account identifier.
-
#account_number ⇒ String
The account number.
-
#created_at ⇒ DateTime
The date the account was created.
-
#display_name ⇒ String
The display name.
-
#status ⇒ String
The status of the account.
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(account_identifier = nil, account_number = nil, display_name = nil, created_at = nil, status = nil) ⇒ AccountSummaryModel
constructor
A new instance of AccountSummaryModel.
Methods inherited from BaseModel
Constructor Details
#initialize(account_identifier = nil, account_number = nil, display_name = nil, created_at = nil, status = nil) ⇒ AccountSummaryModel
Returns a new instance of AccountSummaryModel.
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/raas/models/account_summary_model.rb', line 39 def initialize(account_identifier = nil, account_number = nil, display_name = nil, created_at = nil, status = nil) @account_identifier = account_identifier @account_number = account_number @display_name = display_name @created_at = created_at @status = status end |
Instance Attribute Details
#account_identifier ⇒ String
The account identifier
10 11 12 |
# File 'lib/raas/models/account_summary_model.rb', line 10 def account_identifier @account_identifier end |
#account_number ⇒ String
The account number
14 15 16 |
# File 'lib/raas/models/account_summary_model.rb', line 14 def account_number @account_number end |
#created_at ⇒ DateTime
The date the account was created
22 23 24 |
# File 'lib/raas/models/account_summary_model.rb', line 22 def created_at @created_at end |
#display_name ⇒ String
The display name
18 19 20 |
# File 'lib/raas/models/account_summary_model.rb', line 18 def display_name @display_name end |
#status ⇒ String
The status of the account
26 27 28 |
# File 'lib/raas/models/account_summary_model.rb', line 26 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/raas/models/account_summary_model.rb', line 52 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_identifier = hash['accountIdentifier'] account_number = hash['accountNumber'] display_name = hash['displayName'] created_at = APIHelper.rfc3339(hash['createdAt']) if hash['createdAt'] status = hash['status'] # Create object from extracted values. AccountSummaryModel.new(account_identifier, account_number, display_name, created_at, status) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 37 |
# File 'lib/raas/models/account_summary_model.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['account_identifier'] = 'accountIdentifier' @_hash['account_number'] = 'accountNumber' @_hash['display_name'] = 'displayName' @_hash['created_at'] = 'createdAt' @_hash['status'] = 'status' @_hash end |