Module: Browser::Actions

Included in:
Browser
Defined in:
lib/common/browser/actions.rb

Instance Method Summary collapse

Instance Method Details

#get(url, params = {}) ⇒ Typhoeus::Response

Parameters:

  • url (String)
  • params (Hash) (defaults to: {})

Returns:


10
11
12
# File 'lib/common/browser/actions.rb', line 10

def get(url, params = {})
  process(url, params.merge(method: :get))
end

#get_and_follow_location(url, params = {}) ⇒ Typhoeus::Response

Parameters:

  • url (String)
  • params (Hash) (defaults to: {})

Returns:


34
35
36
37
38
# File 'lib/common/browser/actions.rb', line 34

def get_and_follow_location(url, params = {})
  params[:maxredirs] ||= 2

  get(url, params.merge(followlocation: true))
end

#head(url, params = {}) ⇒ Typhoeus::Response

Parameters:

  • url (String)
  • params (Hash) (defaults to: {})

Returns:


26
27
28
# File 'lib/common/browser/actions.rb', line 26

def head(url, params = {})
  process(url, params.merge(method: :head))
end

#post(url, params = {}) ⇒ Typhoeus::Response

Parameters:

  • url (String)
  • params (Hash) (defaults to: {})

Returns:


18
19
20
# File 'lib/common/browser/actions.rb', line 18

def post(url, params = {})
  process(url, params.merge(method: :post))
end