Class: Connection

Inherits:
Object
  • Object
show all
Includes:
Rack::Test::Methods
Defined in:
lib/blindfold/connection.rb

Instance Method Summary collapse

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
   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_inObject



9
10
11
# File 'lib/blindfold/connection.rb', line 9

def 
  # Define for your app's process of logging in
end

#responseObject



19
20
21
# File 'lib/blindfold/connection.rb', line 19

def response
  last_response
end

#xmlObject



23
24
25
# File 'lib/blindfold/connection.rb', line 23

def xml
  Nokogiri::XML(last_response.body)
end