Sha256: e46e963dff1cff6e8877710bf33ad5c00e81c0b7a4c947b5088a954d64fadff7

Contents?: true

Size: 366 Bytes

Versions: 2

Compression:

Stored size: 366 Bytes

Contents

# frozen_string_literal: true

require 'yaml'

module Bs2Api
  module Util
    class BankService
      class << self
        def find_by_code code
          bank_list.find {|b| b["code"] == code }
        end

        private
          def bank_list
            @bank_list ||= YAML.load_file(File.join(__dir__, 'banks.yml'))
          end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bs2_api-0.2.1 lib/bs2_api/util/bank_service.rb
bs2_api-0.2.0 lib/bs2_api/util/bank_service.rb