Class: Hinoki::Connection
- Inherits:
-
Object
- Object
- Hinoki::Connection
- Defined in:
- lib/hinoki/connection.rb
Instance Method Summary collapse
-
#delete(path) ⇒ Object
Wrapper around Net::HTTP.delete.
-
#get(path) ⇒ Object
Wrapper around Net::HTTP.get.
-
#initialize ⇒ Connection
constructor
A new instance of Connection.
-
#post(path) ⇒ Object
Wrapper around Net::HTTP.post.
Constructor Details
#initialize ⇒ Connection
Returns a new instance of Connection.
10 11 12 13 |
# File 'lib/hinoki/connection.rb', line 10 def initialize @config = Hinoki::Config.new @http = Net::HTTP.new(@config.host, @config.port) end |
Instance Method Details
#delete(path) ⇒ Object
Wrapper around Net::HTTP.delete
26 27 28 |
# File 'lib/hinoki/connection.rb', line 26 def delete(path) return interpret_response(@http.delete(path)) end |
#get(path) ⇒ Object
Wrapper around Net::HTTP.get
16 17 18 |
# File 'lib/hinoki/connection.rb', line 16 def get(path) return interpret_response(@http.get(path)) end |
#post(path) ⇒ Object
Wrapper around Net::HTTP.post
21 22 23 |
# File 'lib/hinoki/connection.rb', line 21 def post(path) return interpret_response(@http.post(path)) end |