Module: Spree::PaypalPlatform::PaymentMethodDecorator

Defined in:
app/models/spree/paypal_platform/payment_method_decorator.rb

Overview

Adds a paypal_platform scope and predicate onto Spree::PaymentMethod.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(base) ⇒ void

This method returns an undefined value.

Parameters:

  • base (Class)


13
14
15
16
17
# File 'app/models/spree/paypal_platform/payment_method_decorator.rb', line 13

def self.prepended(base)
  base.scope :paypal_platform, lambda {
    where(type: Spree::PaypalPlatform.gateway_type_names)
  }
end

Instance Method Details

#paypal_platform?TrueClass, FalseClass

Returns:

  • (TrueClass, FalseClass)


22
23
24
# File 'app/models/spree/paypal_platform/payment_method_decorator.rb', line 22

def paypal_platform?
  Spree::PaypalPlatform.gateway_type_names.include?(type)
end