Class: CardConnect::Service::ProfilePutResponse
- Inherits:
-
Object
- Object
- CardConnect::Service::ProfilePutResponse
- Includes:
- Utils
- Defined in:
- lib/cardconnect/services/profile/profile_put_response.rb
Constant Summary collapse
- FIELDS =
[:profileid, :acctid, :respstat, :account, :respcode, :resptext, :respproc, :accttype, :expiry, :name, :address, :city, :region, :country, :phone, :postal, :ssnl4, :email, :defaultacct, :license, :gsacard, :auoptout, :token]
- STATUS_APPROVED =
'A'
- STATUS_RETRY =
'B'
- STATUS_DECLINED =
'C'
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(response) ⇒ ProfilePutResponse
constructor
A new instance of ProfilePutResponse.
- #success? ⇒ Boolean
Methods included from Utils
#set_attributes, #symbolize_keys
Constructor Details
#initialize(response) ⇒ ProfilePutResponse
Returns a new instance of ProfilePutResponse.
17 18 19 20 21 |
# File 'lib/cardconnect/services/profile/profile_put_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.
11 12 13 |
# File 'lib/cardconnect/services/profile/profile_put_response.rb', line 11 def errors @errors end |
Instance Method Details
#body ⇒ Object
27 28 29 |
# File 'lib/cardconnect/services/profile/profile_put_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_put_response.rb', line 23 def success? errors.empty? end |