Sha256: 3d4da298c46809553f52dfde6b36a7fe5fb0f1288e8e197a6cd06b72f6eb42de

Contents?: true

Size: 532 Bytes

Versions: 6

Compression:

Stored size: 532 Bytes

Contents

module Comable
  module PaymentMethod
    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

6 entries across 6 versions & 2 rubygems

Version Path
comable_core-0.2.3 lib/comable/payment_method/base.rb
comable_core-0.2.2 lib/comable/payment_method/base.rb
comable_core-0.2.1 lib/comable/payment_method/base.rb
comable_core-0.2.0 lib/comable/payment_method/base.rb
comable_core-0.1.0 lib/comable/payment_method/base.rb
comable-0.0.3 lib/comable/payment_method/base.rb