Class: WebPay::BasicListRequest
- Inherits:
-
Entity
- Object
- Entity
- WebPay::BasicListRequest
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
Returns a new instance of BasicListRequest.
1148
1149
1150
1151
1152
|
# File 'lib/webpay/data_types.rb', line 1148
def initialize(hash = {})
hash = normalize_hash(hash)
hash['created'] = hash['created'].is_a?(Hash) ? WebPay::CreatedRange.new(hash['created']) : hash['created']
@attributes = hash
end
|
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
1131
1132
1133
|
# File 'lib/webpay/data_types.rb', line 1131
def attributes
@attributes
end
|
Class Method Details
.create(params) ⇒ Object
1138
1139
1140
1141
1142
1143
1144
1145
1146
|
# File 'lib/webpay/data_types.rb', line 1138
def self.create(params)
return params if params.is_a?(self)
hash = case params
when Hash; params
else
raise WebPay::InvalidRequestError.new("#{self} does not accept the given value", params)
end
self.new(hash)
end
|
.fields ⇒ Object
1133
1134
1135
|
# File 'lib/webpay/data_types.rb', line 1133
def self.fields
['count', 'offset', 'created']
end
|
Instance Method Details
#count ⇒ Object
1170
1171
1172
|
# File 'lib/webpay/data_types.rb', line 1170
def count
attributes['count']
end
|
#count=(value) ⇒ Object
1174
1175
1176
|
# File 'lib/webpay/data_types.rb', line 1174
def count=(value)
attributes['count'] = value
end
|
#created ⇒ Object
1186
1187
1188
|
# File 'lib/webpay/data_types.rb', line 1186
def created
attributes['created']
end
|
#created=(value) ⇒ Object
1190
1191
1192
1193
|
# File 'lib/webpay/data_types.rb', line 1190
def created=(value)
value = value.is_a?(Hash) ? WebPay::CreatedRange.new(value) : value
attributes['created'] = value
end
|
#offset ⇒ Object
1178
1179
1180
|
# File 'lib/webpay/data_types.rb', line 1178
def offset
attributes['offset']
end
|
#offset=(value) ⇒ Object
1182
1183
1184
|
# File 'lib/webpay/data_types.rb', line 1182
def offset=(value)
attributes['offset'] = value
end
|
#query_params ⇒ Object
1160
1161
1162
1163
1164
1165
1166
|
# File 'lib/webpay/data_types.rb', line 1160
def query_params
result = {}
copy_if_exists(@attributes, result, 'count', 'query_params');
copy_if_exists(@attributes, result, 'offset', 'query_params');
copy_if_exists(@attributes, result, 'created', 'query_params');
return result
end
|
#request_body ⇒ Object
1155
1156
1157
1158
|
# File 'lib/webpay/data_types.rb', line 1155
def request_body
result = {}
result
end
|