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.



2114
2115
2116
2117
2118
# File 'lib/webpay/data_types.rb', line 2114

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.



2097
2098
2099
# File 'lib/webpay/data_types.rb', line 2097

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



2104
2105
2106
2107
2108
2109
2110
2111
2112
# File 'lib/webpay/data_types.rb', line 2104

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



2099
2100
2101
# File 'lib/webpay/data_types.rb', line 2099

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

Instance Method Details

#countObject

attributes accessors



2139
2140
2141
# File 'lib/webpay/data_types.rb', line 2139

def count
  attributes['count']
end

#count=(value) ⇒ Object



2143
2144
2145
# File 'lib/webpay/data_types.rb', line 2143

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

#createdObject



2155
2156
2157
# File 'lib/webpay/data_types.rb', line 2155

def created
  attributes['created']
end

#created=(value) ⇒ Object



2159
2160
2161
2162
# File 'lib/webpay/data_types.rb', line 2159

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

#customerObject



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

def customer
  attributes['customer']
end

#customer=(value) ⇒ Object



2168
2169
2170
# File 'lib/webpay/data_types.rb', line 2168

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

#offsetObject



2147
2148
2149
# File 'lib/webpay/data_types.rb', line 2147

def offset
  attributes['offset']
end

#offset=(value) ⇒ Object



2151
2152
2153
# File 'lib/webpay/data_types.rb', line 2151

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

#query_paramsObject



2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
# File 'lib/webpay/data_types.rb', line 2126

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



2121
2122
2123
2124
# File 'lib/webpay/data_types.rb', line 2121

def request_body
  result = {}
  result
end

#shopObject



2172
2173
2174
# File 'lib/webpay/data_types.rb', line 2172

def shop
  attributes['shop']
end

#shop=(value) ⇒ Object



2176
2177
2178
# File 'lib/webpay/data_types.rb', line 2176

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

#suspendedObject



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

def suspended
  attributes['suspended']
end

#suspended=(value) ⇒ Object



2184
2185
2186
# File 'lib/webpay/data_types.rb', line 2184

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