Module: AbCrunch::Page

Defined in:
lib/abcrunch/page.rb

Class Method Summary collapse

Class Method Details

.get_display_url(page) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/abcrunch/page.rb', line 17

def self.get_display_url(page)
  if page[:url].respond_to? :call
    return "Dynamic url example: #{page[:url].call}"
  else
    page[:url]
  end
end

.get_url(page, force_new = false) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/abcrunch/page.rb', line 3

def self.get_url(page, force_new = false)
  if force_new || !page[:testing_url]
    url = page[:url]
    if url.respond_to? :call
      url = url.call
    end
    page[:testing_url] = url
  else
    url = page[:testing_url]
  end

  url
end