Class: WebPay::RecursionRequestCreate

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

Returns a new instance of RecursionRequestCreate.



1986
1987
1988
1989
# File 'lib/webpay/data_types.rb', line 1986

def initialize(hash = {})
  hash = normalize_hash(hash)
  @attributes = hash
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



1969
1970
1971
# File 'lib/webpay/data_types.rb', line 1969

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



1976
1977
1978
1979
1980
1981
1982
1983
1984
# File 'lib/webpay/data_types.rb', line 1976

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



1971
1972
1973
# File 'lib/webpay/data_types.rb', line 1971

def self.fields
  ['amount', 'currency', 'customer', 'period', 'description', 'shop', 'first_scheduled', 'uuid']
end

Instance Method Details

#amountObject

attributes accessors



2012
2013
2014
# File 'lib/webpay/data_types.rb', line 2012

def amount
  attributes['amount']
end

#amount=(value) ⇒ Object



2016
2017
2018
# File 'lib/webpay/data_types.rb', line 2016

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

#currencyObject



2020
2021
2022
# File 'lib/webpay/data_types.rb', line 2020

def currency
  attributes['currency']
end

#currency=(value) ⇒ Object



2024
2025
2026
# File 'lib/webpay/data_types.rb', line 2024

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

#customerObject



2028
2029
2030
# File 'lib/webpay/data_types.rb', line 2028

def customer
  attributes['customer']
end

#customer=(value) ⇒ Object



2032
2033
2034
# File 'lib/webpay/data_types.rb', line 2032

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

#descriptionObject



2044
2045
2046
# File 'lib/webpay/data_types.rb', line 2044

def description
  attributes['description']
end

#description=(value) ⇒ Object



2048
2049
2050
# File 'lib/webpay/data_types.rb', line 2048

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

#first_scheduledObject



2060
2061
2062
# File 'lib/webpay/data_types.rb', line 2060

def first_scheduled
  attributes['first_scheduled']
end

#first_scheduled=(value) ⇒ Object



2064
2065
2066
# File 'lib/webpay/data_types.rb', line 2064

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

#periodObject



2036
2037
2038
# File 'lib/webpay/data_types.rb', line 2036

def period
  attributes['period']
end

#period=(value) ⇒ Object



2040
2041
2042
# File 'lib/webpay/data_types.rb', line 2040

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

#query_paramsObject



2005
2006
2007
2008
# File 'lib/webpay/data_types.rb', line 2005

def query_params
  result = {}
  return result
end

#request_bodyObject



1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
# File 'lib/webpay/data_types.rb', line 1992

def request_body
  result = {}
  copy_if_exists(@attributes, result, 'amount', 'request_body');
  copy_if_exists(@attributes, result, 'currency', 'request_body');
  copy_if_exists(@attributes, result, 'customer', 'request_body');
  copy_if_exists(@attributes, result, 'period', 'request_body');
  copy_if_exists(@attributes, result, 'description', 'request_body');
  copy_if_exists(@attributes, result, 'shop', 'request_body');
  copy_if_exists(@attributes, result, 'first_scheduled', 'request_body');
  copy_if_exists(@attributes, result, 'uuid', 'request_body');
  result
end

#shopObject



2052
2053
2054
# File 'lib/webpay/data_types.rb', line 2052

def shop
  attributes['shop']
end

#shop=(value) ⇒ Object



2056
2057
2058
# File 'lib/webpay/data_types.rb', line 2056

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

#uuidObject



2068
2069
2070
# File 'lib/webpay/data_types.rb', line 2068

def uuid
  attributes['uuid']
end

#uuid=(value) ⇒ Object



2072
2073
2074
# File 'lib/webpay/data_types.rb', line 2072

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