Class: WebPay::ShopResponseList

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

Returns a new instance of ShopResponseList.



1923
1924
1925
1926
1927
# File 'lib/webpay/data_types.rb', line 1923

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



1916
1917
1918
# File 'lib/webpay/data_types.rb', line 1916

def attributes
  @attributes
end

Class Method Details

.fieldsObject



1918
1919
1920
# File 'lib/webpay/data_types.rb', line 1918

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

Instance Method Details

#countObject



1940
1941
1942
# File 'lib/webpay/data_types.rb', line 1940

def count
  attributes['count']
end

#dataObject



1944
1945
1946
# File 'lib/webpay/data_types.rb', line 1944

def data
  attributes['data']
end

#objectObject

attributes accessors



1932
1933
1934
# File 'lib/webpay/data_types.rb', line 1932

def object
  attributes['object']
end

#urlObject



1936
1937
1938
# File 'lib/webpay/data_types.rb', line 1936

def url
  attributes['url']
end