Class: OFX::HTTP
- Inherits:
-
Object
- Object
- OFX::HTTP
- Defined in:
- lib/ofx/http.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #headers ⇒ Object
-
#initialize(options = {}) ⇒ HTTP
constructor
A new instance of HTTP.
- #raw_headers ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ HTTP
Returns a new instance of HTTP.
6 7 8 |
# File 'lib/ofx/http.rb', line 6 def initialize( = {}) @uri = [:uri] || ENV['OFX_URI'] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/ofx/http.rb', line 4 def body @body end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
4 5 6 |
# File 'lib/ofx/http.rb', line 4 def uri @uri end |
Instance Method Details
#headers ⇒ Object
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_headers ⇒ Object
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 |