Class: SixSaferpay::Brand

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payment_method: nil, name:) ⇒ Brand

Returns a new instance of Brand.



6
7
8
9
# File 'lib/six_saferpay/models/brand.rb', line 6

def initialize(payment_method: nil, name:)
  @payment_method = payment_method
  @name = name
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#payment_methodObject

Returns the value of attribute payment_method.



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

def payment_method
  @payment_method
end

Instance Method Details

#to_hashObject Also known as: to_h



11
12
13
14
15
16
# File 'lib/six_saferpay/models/brand.rb', line 11

def to_hash
  hash = Hash.new
  hash.merge!(payment_method: @payment_method) if @payment_method
  hash.merge!(name: @name) if @name
  hash
end