Sha256: 20cfad350f4daf6f29fbc31e6afa262b81a5803135d2ba96e8787f0d8804ed07

Contents?: true

Size: 731 Bytes

Versions: 9

Compression:

Stored size: 731 Bytes

Contents

module Comable
  module PaymentProvider
    class Base
      class << self
        def name_symbol
          name.demodulize.underscore.to_sym
        end

        def display_name
          please_implement_method
        end

        def kind
          please_implement_method
        end

        def authorize!
          true
        end

        def complete!
          true
        end

        def cancel!
          true
        end

        def resume!
          true
        end

        private

        def please_implement_method
          calling_method_name = caller_locations(1, 1).first.label
          fail "You should implement '#{calling_method_name}' method in #{name}."
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
comable-core-0.7.1 lib/comable/payment_provider/base.rb
comable-core-0.7.0 lib/comable/payment_provider/base.rb
comable-core-0.7.0.beta2 lib/comable/payment_provider/base.rb
comable-core-0.7.0.beta1 lib/comable/payment_provider/base.rb
comable-core-0.6.0 lib/comable/payment_provider/base.rb
comable_core-0.5.0 lib/comable/payment_provider/base.rb
comable_core-0.4.2 lib/comable/payment_provider/base.rb
comable_core-0.4.1 lib/comable/payment_provider/base.rb
comable_core-0.4.0 lib/comable/payment_provider/base.rb