Sha256: 28f6a503f6f953422ad2b9c48d593788846e0d1fa1592c00faaeee180dc47909

Contents?: true

Size: 688 Bytes

Versions: 9

Compression:

Stored size: 688 Bytes

Contents

module AchClient
  class Abstract
      # Interface for storing company credentials used with a provider
    class CompanyInfo

      ##
      # @return [CompanyInfo] instance built from configuration values
      def self.build
        raise AbstractMethodError
      end

      ##
      # Build a hash to send to provider
      # @return [Hash] hash to send to provider
      def to_hash
        raise AbstractMethodError
      end

      private_class_method def self.build_from_config(args)
        args_hash = args.map do |arg|
            {arg => self.to_s.deconstantize.constantize.send(arg)}
          end.reduce(&:merge)
        self.new(**args_hash)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ach_client-5.3.4 lib/ach_client/providers/abstract/company_info.rb
ach_client-5.3.3 lib/ach_client/providers/abstract/company_info.rb
ach_client-5.3.2 lib/ach_client/providers/abstract/company_info.rb
ach_client-5.3.1 lib/ach_client/providers/abstract/company_info.rb
ach_client-5.3.0 lib/ach_client/providers/abstract/company_info.rb
ach_client-5.2.0 lib/ach_client/providers/abstract/company_info.rb
ach_client-5.1.0 lib/ach_client/providers/abstract/company_info.rb
ach_client-5.0.0 lib/ach_client/providers/abstract/company_info.rb
ach_client-4.0.0 lib/ach_client/providers/abstract/company_info.rb