Class: Connection
- Inherits:
-
Object
- Object
- Connection
- Includes:
- Rack::Test::Methods
- Defined in:
- lib/blindfold/connection.rb
Instance Method Summary collapse
- #call(name, params = {}) ⇒ Object
-
#initialize(args = {}) ⇒ Connection
constructor
A new instance of Connection.
- #log_in ⇒ Object
- #response ⇒ Object
- #xml ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Connection
Returns a new instance of Connection.
4 5 6 7 |
# File 'lib/blindfold/connection.rb', line 4 def initialize(args={}) perform_pre_flight_check log_in unless args.has_key?(:logged_in) && !args[:logged_in] end |
Instance Method Details
#call(name, params = {}) ⇒ Object
13 14 15 16 17 |
# File 'lib/blindfold/connection.rb', line 13 def call(name, params={}) method, url = resolve(name) process_request method, url, params @cookie_session_id = last_response.headers['Set-Cookie'] end |
#log_in ⇒ Object
9 10 11 |
# File 'lib/blindfold/connection.rb', line 9 def log_in # Define for your app's process of logging in end |
#response ⇒ Object
19 20 21 |
# File 'lib/blindfold/connection.rb', line 19 def response last_response end |
#xml ⇒ Object
23 24 25 |
# File 'lib/blindfold/connection.rb', line 23 def xml Nokogiri::XML(last_response.body) end |