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.



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

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



1950
1951
1952
# File 'lib/webpay/data_types.rb', line 1950

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



1957
1958
1959
1960
1961
1962
1963
1964
1965
# File 'lib/webpay/data_types.rb', line 1957

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



1952
1953
1954
# File 'lib/webpay/data_types.rb', line 1952

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

Instance Method Details

#amountObject

attributes accessors



1993
1994
1995
# File 'lib/webpay/data_types.rb', line 1993

def amount
  attributes['amount']
end

#amount=(value) ⇒ Object



1997
1998
1999
# File 'lib/webpay/data_types.rb', line 1997

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

#currencyObject



2001
2002
2003
# File 'lib/webpay/data_types.rb', line 2001

def currency
  attributes['currency']
end

#currency=(value) ⇒ Object



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

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

#customerObject



2009
2010
2011
# File 'lib/webpay/data_types.rb', line 2009

def customer
  attributes['customer']
end

#customer=(value) ⇒ Object



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

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

#descriptionObject



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

def description
  attributes['description']
end

#description=(value) ⇒ Object



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

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

#first_scheduledObject



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

def first_scheduled
  attributes['first_scheduled']
end

#first_scheduled=(value) ⇒ Object



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

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

#periodObject



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

def period
  attributes['period']
end

#period=(value) ⇒ Object



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

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

#query_paramsObject



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

def query_params
  result = {}
  return result
end

#request_bodyObject



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

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



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

def shop
  attributes['shop']
end

#shop=(value) ⇒ Object



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

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

#uuidObject



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

def uuid
  attributes['uuid']
end

#uuid=(value) ⇒ Object



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

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