class EwayRapid::DirectCustomerSearchResponse

Attributes

customers[RW]
errors[RW]

Public Class Methods

from_hash(hash) click to toggle source
# File lib/eway_rapid/entities/direct_customer_search_response.rb, line 16
def self.from_hash(hash)
  response = DirectCustomerSearchResponse.new
  response.customers = InternalModels::Customer.from_array(hash[Constants::CUSTOMERS])
  response.errors = hash[Constants::ERRORS_CAPITALIZED]
  response
end
from_json(json) click to toggle source
# File lib/eway_rapid/entities/direct_customer_search_response.rb, line 11
def self.from_json(json)
  hash = JSON.parse(json)
  from_hash(hash)
end

Public Instance Methods

to_json(options={}) click to toggle source
# File lib/eway_rapid/entities/direct_customer_search_response.rb, line 6
def to_json(options={})
  {Constants::CUSTOMERS => customers,
   Constants::ERRORS => errors}.to_json
end