Class: OnlinePayments::SDK::Domain::PaymentLinksResponse
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::PaymentLinksResponse
- Defined in:
- lib/onlinepayments/sdk/domain/payment_links_response.rb
Instance Attribute Summary collapse
-
#payment_links ⇒ Array<OnlinePayments::SDK::Domain::PaymentLinkResponse>
The current value of payment_links.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#payment_links ⇒ Array<OnlinePayments::SDK::Domain::PaymentLinkResponse>
Returns the current value of payment_links.
11 12 13 |
# File 'lib/onlinepayments/sdk/domain/payment_links_response.rb', line 11 def payment_links @payment_links end |
Instance Method Details
#from_hash(hash) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/onlinepayments/sdk/domain/payment_links_response.rb', line 22 def from_hash(hash) super if hash.has_key? 'PaymentLinks' raise TypeError, "value '%s' is not an Array" % [hash['PaymentLinks']] unless hash['PaymentLinks'].is_a? Array @payment_links = [] hash['PaymentLinks'].each do |e| @payment_links << OnlinePayments::SDK::Domain::PaymentLinkResponse.new_from_hash(e) end end end |
#to_h ⇒ Hash
16 17 18 19 20 |
# File 'lib/onlinepayments/sdk/domain/payment_links_response.rb', line 16 def to_h hash = super hash['PaymentLinks'] = @payment_links.collect{|val| val.to_h} unless @payment_links.nil? hash end |