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.



1222
1223
1224
1225
1226
# File 'lib/webpay/data_types.rb', line 1222

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.



1215
1216
1217
# File 'lib/webpay/data_types.rb', line 1215

def attributes
  @attributes
end

Class Method Details

.fieldsObject



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

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

Instance Method Details

#countObject



1239
1240
1241
# File 'lib/webpay/data_types.rb', line 1239

def count
  attributes['count']
end

#dataObject



1243
1244
1245
# File 'lib/webpay/data_types.rb', line 1243

def data
  attributes['data']
end

#objectObject

attributes accessors



1231
1232
1233
# File 'lib/webpay/data_types.rb', line 1231

def object
  attributes['object']
end

#urlObject



1235
1236
1237
# File 'lib/webpay/data_types.rb', line 1235

def url
  attributes['url']
end