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.



1929
1930
1931
1932
# File 'lib/webpay/data_types.rb', line 1929

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



1912
1913
1914
# File 'lib/webpay/data_types.rb', line 1912

def attributes
  @attributes
end

Class Method Details

.create(params) ⇒ Object



1919
1920
1921
1922
1923
1924
1925
1926
1927
# File 'lib/webpay/data_types.rb', line 1919

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



1914
1915
1916
# File 'lib/webpay/data_types.rb', line 1914

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

Instance Method Details

#amountObject

attributes accessors



1963
1964
1965
# File 'lib/webpay/data_types.rb', line 1963

def amount
  attributes['amount']
end

#amount=(value) ⇒ Object



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

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

#currencyObject



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

def currency
  attributes['currency']
end

#currency=(value) ⇒ Object



1977
1978
1979
# File 'lib/webpay/data_types.rb', line 1977

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

#customerObject



1981
1982
1983
# File 'lib/webpay/data_types.rb', line 1981

def customer
  attributes['customer']
end

#customer=(value) ⇒ Object



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

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

#descriptionObject



1999
2000
2001
# File 'lib/webpay/data_types.rb', line 1999

def description
  attributes['description']
end

#description=(value) ⇒ Object



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

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

#first_scheduledObject



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

def first_scheduled
  attributes['first_scheduled']
end

#first_scheduled=(value) ⇒ Object



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

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

#periodObject



1990
1991
1992
# File 'lib/webpay/data_types.rb', line 1990

def period
  attributes['period']
end

#period=(value) ⇒ Object



1995
1996
1997
# File 'lib/webpay/data_types.rb', line 1995

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

#query_paramsObject



1956
1957
1958
1959
# File 'lib/webpay/data_types.rb', line 1956

def query_params
  result = {}
  return result
end

#request_bodyObject



1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
# File 'lib/webpay/data_types.rb', line 1935

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



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

def shop
  attributes['shop']
end

#shop=(value) ⇒ Object



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

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

#uuidObject



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

def uuid
  attributes['uuid']
end

#uuid=(value) ⇒ Object



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

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