Class: EwayRapid::TransactionSearchResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/eway_rapid/entities/transaction_search_response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#errorObject

Returns the value of attribute error.



4
5
6
# File 'lib/eway_rapid/entities/transaction_search_response.rb', line 4

def error
  @error
end

#transactionsObject

Returns the value of attribute transactions.



3
4
5
# File 'lib/eway_rapid/entities/transaction_search_response.rb', line 3

def transactions
  @transactions
end

Class Method Details

.from_hash(hash) ⇒ Object



16
17
18
19
20
21
# File 'lib/eway_rapid/entities/transaction_search_response.rb', line 16

def self.from_hash(hash)
  transaction_search_response = TransactionSearchResponse.new
  transaction_search_response.transactions = InternalModels::Transaction.from_array(hash[Constants::TRANSACTIONS])
  transaction_search_response.error = hash[Constants::ERRORS_CAPITALIZED]
  transaction_search_response
end

.from_json(json) ⇒ Object



11
12
13
14
# File 'lib/eway_rapid/entities/transaction_search_response.rb', line 11

def self.from_json(json)
  hash = JSON.parse(json)
  from_hash(hash)
end

Instance Method Details

#to_json(options = {}) ⇒ Object



6
7
8
9
# File 'lib/eway_rapid/entities/transaction_search_response.rb', line 6

def to_json(options={})
  {Constants::TRANSACTIONS => transactions,
   Constants::ERRORS_CAPITALIZED => error}.to_json
end