Class: WebPay::RecursionListRequest

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

Returns a new instance of RecursionListRequest.



2179
2180
2181
2182
2183
# File 'lib/webpay/data_types.rb', line 2179

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

#attributesObject (readonly)

Returns the value of attribute attributes.



2162
2163
2164
# File 'lib/webpay/data_types.rb', line 2162

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



2169
2170
2171
2172
2173
2174
2175
2176
2177
# File 'lib/webpay/data_types.rb', line 2169

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

.fieldsObject



2164
2165
2166
# File 'lib/webpay/data_types.rb', line 2164

def self.fields
  ['count', 'offset', 'created', 'customer', 'shop', 'suspended']
end

Instance Method Details

#countObject

attributes accessors



2204
2205
2206
# File 'lib/webpay/data_types.rb', line 2204

def count
  attributes['count']
end

#count=(value) ⇒ Object



2208
2209
2210
# File 'lib/webpay/data_types.rb', line 2208

def count=(value)
  attributes['count'] = value
end

#createdObject



2220
2221
2222
# File 'lib/webpay/data_types.rb', line 2220

def created
  attributes['created']
end

#created=(value) ⇒ Object



2224
2225
2226
2227
# File 'lib/webpay/data_types.rb', line 2224

def created=(value)
  value = value.is_a?(Hash) ? WebPay::CreatedRange.new(value) : value
  attributes['created'] = value
end

#customerObject



2229
2230
2231
# File 'lib/webpay/data_types.rb', line 2229

def customer
  attributes['customer']
end

#customer=(value) ⇒ Object



2233
2234
2235
# File 'lib/webpay/data_types.rb', line 2233

def customer=(value)
  attributes['customer'] = value
end

#offsetObject



2212
2213
2214
# File 'lib/webpay/data_types.rb', line 2212

def offset
  attributes['offset']
end

#offset=(value) ⇒ Object



2216
2217
2218
# File 'lib/webpay/data_types.rb', line 2216

def offset=(value)
  attributes['offset'] = value
end

#query_paramsObject



2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
# File 'lib/webpay/data_types.rb', line 2191

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');
  copy_if_exists(@attributes, result, 'customer', 'query_params');
  copy_if_exists(@attributes, result, 'shop', 'query_params');
  copy_if_exists(@attributes, result, 'suspended', 'query_params');
  return result
end

#request_bodyObject



2186
2187
2188
2189
# File 'lib/webpay/data_types.rb', line 2186

def request_body
  result = {}
  result
end

#shopObject



2237
2238
2239
# File 'lib/webpay/data_types.rb', line 2237

def shop
  attributes['shop']
end

#shop=(value) ⇒ Object



2241
2242
2243
# File 'lib/webpay/data_types.rb', line 2241

def shop=(value)
  attributes['shop'] = value
end

#suspendedObject



2245
2246
2247
# File 'lib/webpay/data_types.rb', line 2245

def suspended
  attributes['suspended']
end

#suspended=(value) ⇒ Object



2249
2250
2251
# File 'lib/webpay/data_types.rb', line 2249

def suspended=(value)
  attributes['suspended'] = value
end