Class: WebPay::CustomerResponseList

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 = {}) ⇒ CustomerResponseList

Returns a new instance of CustomerResponseList.



1204
1205
1206
1207
1208
# File 'lib/webpay/data_types.rb', line 1204

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



1197
1198
1199
# File 'lib/webpay/data_types.rb', line 1197

def attributes
  @attributes
end

Class Method Details

.fieldsObject



1199
1200
1201
# File 'lib/webpay/data_types.rb', line 1199

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

Instance Method Details

#countObject



1221
1222
1223
# File 'lib/webpay/data_types.rb', line 1221

def count
  attributes['count']
end

#dataObject



1225
1226
1227
# File 'lib/webpay/data_types.rb', line 1225

def data
  attributes['data']
end

#objectObject

attributes accessors



1213
1214
1215
# File 'lib/webpay/data_types.rb', line 1213

def object
  attributes['object']
end

#urlObject



1217
1218
1219
# File 'lib/webpay/data_types.rb', line 1217

def url
  attributes['url']
end