Class: SpreeCmCommissioner::PaymentMethodGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/spree_cm_commissioner/payment_method_group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, payment_methods:) ⇒ PaymentMethodGroup

Returns a new instance of PaymentMethodGroup.



5
6
7
8
9
10
# File 'lib/spree_cm_commissioner/payment_method_group.rb', line 5

def initialize(name:, payment_methods:)
  @id = SecureRandom.hex
  @name = name
  @payment_methods = payment_methods
  @payment_method_ids = payment_methods.pluck(:id)
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/spree_cm_commissioner/payment_method_group.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/spree_cm_commissioner/payment_method_group.rb', line 3

def name
  @name
end

#payment_method_idsObject

Returns the value of attribute payment_method_ids.



3
4
5
# File 'lib/spree_cm_commissioner/payment_method_group.rb', line 3

def payment_method_ids
  @payment_method_ids
end

#payment_methodsObject

Returns the value of attribute payment_methods.



3
4
5
# File 'lib/spree_cm_commissioner/payment_method_group.rb', line 3

def payment_methods
  @payment_methods
end