Class: Voyager::Connection
- Inherits:
-
Object
- Object
- Voyager::Connection
- Defined in:
- lib/voyager_connection.rb
Instance Attribute Summary collapse
-
#http_client ⇒ Object
readonly
Returns the value of attribute http_client.
Instance Method Summary collapse
- #clean_session!(server = "http://vetiver.cc.columbia.edu:7014") ⇒ Object
-
#initialize(options = {}) ⇒ Connection
constructor
A new instance of Connection.
- #request(url, options = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Connection
Returns a new instance of Connection.
6 7 8 9 10 11 12 13 |
# File 'lib/voyager_connection.rb', line 6 def initialize( = {}) @http_client = [:http_client] || HTTPClient.new @cookie_path = [:cookie_path] if @cookie_path end |
Instance Attribute Details
#http_client ⇒ Object (readonly)
Returns the value of attribute http_client.
4 5 6 |
# File 'lib/voyager_connection.rb', line 4 def http_client @http_client end |
Instance Method Details
#clean_session!(server = "http://vetiver.cc.columbia.edu:7014") ⇒ Object
22 23 24 25 |
# File 'lib/voyager_connection.rb', line 22 def clean_session!(server = "http://vetiver.cc.columbia.edu:7014") @http_client.get_content(server + "/vxws/SessionCleanupService") end |
#request(url, options = {}) ⇒ Object
16 17 18 19 20 |
# File 'lib/voyager_connection.rb', line 16 def request(url, = {}) request = @http_client.get_content(url, ) @http_client..(true) if @cookie_path return request end |