Sha256: 64564027e51dbaac6c35bc118c455c99f47e7e558f20a48f07a40cce3c7de4ce

Contents?: true

Size: 748 Bytes

Versions: 1

Compression:

Stored size: 748 Bytes

Contents

module DOF
  class Indicator
    class << self

      def USD_exchange_rate(date: Date.today, end_date: date)
        raw_response = get(Indicator_Codes::USD, date, end_date)
        response = Responses::RequestResponse.new(raw_response)
      end

      def UDIS_exchange_rate(date: Date.today, end_date: date)
        raw_response = get(Indicator_Codes::UDIS, date, end_date)
        response = Responses::RequestResponse.new(raw_response)
      end

      private

      def get(indicator, initial_date, end_date)
        initial_date = DateFormatter.format(initial_date)
        end_date = DateFormatter.format(end_date)

        Client.get path: "#{Endpoints::INDICATORS}/#{indicator}/#{initial_date}/#{end_date}"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dof-1.0.0 lib/DOF/indicator.rb