Class: WebPay::ChargeResponseList

Inherits:
Entity
  • Object
show all
Defined in:
lib/webpay/data_types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#normalize_hash, #to_h, #to_s

Constructor Details

#initialize(hash = {}) ⇒ ChargeResponseList

Returns a new instance of ChargeResponseList.



776
777
778
779
780
# File 'lib/webpay/data_types.rb', line 776

def initialize(hash = {})
  hash = normalize_hash(hash)
  hash['data'] = hash['data'].is_a?(Array) ? hash['data'].map { |x| WebPay::ChargeResponse.new(x) if x.is_a?(Hash) }  : hash['data']
  @attributes = hash
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



769
770
771
# File 'lib/webpay/data_types.rb', line 769

def attributes
  @attributes
end

Class Method Details

.fieldsObject



771
772
773
# File 'lib/webpay/data_types.rb', line 771

def self.fields
  ['object', 'url', 'count', 'data']
end

Instance Method Details

#countObject



793
794
795
# File 'lib/webpay/data_types.rb', line 793

def count
  attributes['count']
end

#dataObject



797
798
799
# File 'lib/webpay/data_types.rb', line 797

def data
  attributes['data']
end

#objectObject

attributes accessors



785
786
787
# File 'lib/webpay/data_types.rb', line 785

def object
  attributes['object']
end

#urlObject



789
790
791
# File 'lib/webpay/data_types.rb', line 789

def url
  attributes['url']
end