Class: CardConnect::Service::ProfileGetResponse
- Inherits:
-
Object
- Object
- CardConnect::Service::ProfileGetResponse
- Includes:
- Utils
- Defined in:
- lib/cardconnect/services/profile/profile_get_response.rb
Constant Summary collapse
- FIELDS =
[:gsacard, :profileid, :acctid, :respstat, :account, :respcode, :resptext, :respproc, :accttype, :expiry, :name, :address, :city, :region, :country, :phone, :postal, :ssnl4, :email, :defaultacct, :license, :token, :auoptout]
- STATUS_APPROVED =
'A'
- STATUS_NOT_FOUND =
'C'
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(response) ⇒ ProfileGetResponse
constructor
A new instance of ProfileGetResponse.
- #success? ⇒ Boolean
Methods included from Utils
#set_attributes, #symbolize_keys
Constructor Details
#initialize(response) ⇒ ProfileGetResponse
Returns a new instance of ProfileGetResponse.
17 18 19 20 21 |
# File 'lib/cardconnect/services/profile/profile_get_response.rb', line 17 def initialize(response) set_attributes(response, FIELDS) @errors = [] process_errors end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
12 13 14 |
# File 'lib/cardconnect/services/profile/profile_get_response.rb', line 12 def errors @errors end |
Instance Method Details
#body ⇒ Object
27 28 29 |
# File 'lib/cardconnect/services/profile/profile_get_response.rb', line 27 def body FIELDS.collect{|attr| {attr => send(attr)} }.reduce({}, :merge) end |
#success? ⇒ Boolean
23 24 25 |
# File 'lib/cardconnect/services/profile/profile_get_response.rb', line 23 def success? errors.empty? end |