Sha256: 9eac220d65b4e5563ece931a44c238aacb9c563c2a09d2eaf2438a95be132705

Contents?: true

Size: 509 Bytes

Versions: 4

Compression:

Stored size: 509 Bytes

Contents

# frozen_string_literal: true
module OFX
  class HTTP
    attr_reader :uri, :body

    def initialize(options = {})
      @uri = options[:uri] || ENV['OFX_URI']
    end

    def uri
      @uri || (raise Errors::URIMissing)
    end

    def headers
      {
        'Content-Type': 'application/x-ofx',
        'Accept': '*/*, application/x-ofx'
      }
    end

    def raw_headers
      headers.inject('') do |result, (key, value)|
        result.dup << "#{key}: #{value}\n"
      end.strip
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ofx_ruby-0.0.14 lib/ofx/http.rb
ofx_ruby-0.0.13 lib/ofx/http.rb
ofx_ruby-0.0.12 lib/ofx/http.rb
ofx_ruby-0.0.11 lib/ofx/http.rb