Class: Homepage

Inherits:
BaseScript show all
Defined in:
lib/scripts/homepage.rb

Instance Method Summary collapse

Constructor Details

#initialize(base_url) ⇒ Homepage

Returns a new instance of Homepage.



2
3
4
5
# File 'lib/scripts/homepage.rb', line 2

def initialize(base_url)
  @base_url = base_url
  @logger = Logger.new
end

Instance Method Details

#runObject



7
8
9
10
11
12
13
# File 'lib/scripts/homepage.rb', line 7

def run
  timer = Timer.new.time do
    request = Request.new("bla", "bla")
    request.get("#{@base_url}/people")
  end
  @logger.log("info", "response time: #{timer.round(2)} seconds")
end