Sha256: 45448ae8d2d296cbfbb81f8a9e3ff09763a48cc9d446bde868edc6075d3116b1

Contents?: true

Size: 534 Bytes

Versions: 5

Compression:

Stored size: 534 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

        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

5 entries across 5 versions & 1 rubygems

Version Path
comable_core-0.3.4 lib/comable/payment_provider/base.rb
comable_core-0.3.3 lib/comable/payment_provider/base.rb
comable_core-0.3.2 lib/comable/payment_provider/base.rb
comable_core-0.3.1 lib/comable/payment_provider/base.rb
comable_core-0.3.0 lib/comable/payment_provider/base.rb