Class: OFX::HTTP

Inherits:
Object
  • Object
show all
Defined in:
lib/ofx/http.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ HTTP

Returns a new instance of HTTP.



6
7
8
# File 'lib/ofx/http.rb', line 6

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

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



4
5
6
# File 'lib/ofx/http.rb', line 4

def body
  @body
end

#uriObject (readonly)

Returns the value of attribute uri.



4
5
6
# File 'lib/ofx/http.rb', line 4

def uri
  @uri
end

Instance Method Details

#headersObject



14
15
16
17
18
19
# File 'lib/ofx/http.rb', line 14

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

#raw_headersObject



21
22
23
24
25
# File 'lib/ofx/http.rb', line 21

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