Class: Fiddler::ConnectionManager::Connection
- Inherits:
-
Object
- Object
- Fiddler::ConnectionManager::Connection
- Defined in:
- lib/fiddler/connection_manager.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#logged_in ⇒ Object
Returns the value of attribute logged_in.
Instance Method Summary collapse
- #get(path, options) ⇒ Object
-
#initialize ⇒ Connection
constructor
A new instance of Connection.
- #post(path, options) ⇒ Object
- #post_content(path, options) ⇒ Object
Constructor Details
#initialize ⇒ Connection
Returns a new instance of Connection.
10 11 12 13 14 |
# File 'lib/fiddler/connection_manager.rb', line 10 def initialize @client = HTTPClient.new @client.("cookies.dat") @logged_in = false end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
8 9 10 |
# File 'lib/fiddler/connection_manager.rb', line 8 def client @client end |
#logged_in ⇒ Object
Returns the value of attribute logged_in.
8 9 10 |
# File 'lib/fiddler/connection_manager.rb', line 8 def logged_in @logged_in end |
Instance Method Details
#get(path, options) ⇒ Object
16 17 18 19 |
# File 'lib/fiddler/connection_manager.rb', line 16 def get(path,) login! unless @logged_in @client.get(url_for(path),).content end |
#post(path, options) ⇒ Object
21 22 23 24 |
# File 'lib/fiddler/connection_manager.rb', line 21 def post(path,) login! unless @logged_in @client.post(url_for(path),).content end |
#post_content(path, options) ⇒ Object
26 27 28 29 |
# File 'lib/fiddler/connection_manager.rb', line 26 def post_content(path,) login! unless @logged_in @client.post_content(url_for(path),) end |