Class: Susuwatari::Result

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/susuwatari/result.rb

Constant Summary collapse

STATUS_URL =
'http://www.webpagetest.org/testStatus.php'
RESULT_URL_PREFIX =
'http://www.webpagetest.org/xmlResult/'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_response) ⇒ Result

Returns a new instance of Result.



17
18
19
20
# File 'lib/susuwatari/result.rb', line 17

def initialize( request_response )
  @request_raw = request_response
  @test_id  = request_raw.data.testId
end

Instance Attribute Details

#current_statusObject (readonly)

Returns the value of attribute current_status.



13
14
15
# File 'lib/susuwatari/result.rb', line 13

def current_status
  @current_status
end

#request_rawObject (readonly)

Returns the value of attribute request_raw.



13
14
15
# File 'lib/susuwatari/result.rb', line 13

def request_raw
  @request_raw
end

#test_idObject (readonly)

Returns the value of attribute test_id.



13
14
15
# File 'lib/susuwatari/result.rb', line 13

def test_id
  @test_id
end

#test_resultObject (readonly)

Returns the value of attribute test_result.



13
14
15
# File 'lib/susuwatari/result.rb', line 13

def test_result
  @test_result
end

Instance Method Details

#statusObject



22
23
24
25
# File 'lib/susuwatari/result.rb', line 22

def status
  fetch_status unless current_status == :complete
  current_status
end