Class: SixSaferpay::AddressForm

Inherits:
Object
  • Object
show all
Defined in:
lib/six_saferpay/models/address_form.rb

Direct Known Subclasses

BillingAddressForm, DeliveryAddressForm

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(display:, mandatory_fields: nil) ⇒ AddressForm

Returns a new instance of AddressForm.



7
8
9
10
11
# File 'lib/six_saferpay/models/address_form.rb', line 7

def initialize(display:,
               mandatory_fields: nil)
  @display = display
  @mandatory_fields = mandatory_fields
end

Instance Attribute Details

#displayObject

Returns the value of attribute display.



4
5
6
# File 'lib/six_saferpay/models/address_form.rb', line 4

def display
  @display
end

#mandatory_fieldsObject

Returns the value of attribute mandatory_fields.



4
5
6
# File 'lib/six_saferpay/models/address_form.rb', line 4

def mandatory_fields
  @mandatory_fields
end

Instance Method Details

#to_hashObject Also known as: to_h



13
14
15
16
17
18
# File 'lib/six_saferpay/models/address_form.rb', line 13

def to_hash
  hash = Hash.new
  hash.merge!(display: @display) if !@display.nil?
  hash.merge!(mandatory_fields: @mandatory_fields) if @mandatory_fields
  hash
end