Class: Computron::Report::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/computron/report.rb

Defined Under Namespace

Classes: Response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Request

Returns a new instance of Request.

Yields:

  • (_self)

Yield Parameters:



22
23
24
25
# File 'lib/computron/report.rb', line 22

def initialize
  @response = Response.new
  yield self if block_given?
end

Instance Attribute Details

#atObject

Returns the value of attribute at.



11
12
13
# File 'lib/computron/report.rb', line 11

def at
  @at
end

#headersObject

Returns the value of attribute headers.



11
12
13
# File 'lib/computron/report.rb', line 11

def headers
  @headers
end

#methodObject

Returns the value of attribute method.



11
12
13
# File 'lib/computron/report.rb', line 11

def method
  @method
end

#response {|@response| ... } ⇒ Object

Returns the value of attribute response.

Yields:



11
12
13
# File 'lib/computron/report.rb', line 11

def response
  @response
end

#uriObject

Returns the value of attribute uri.



11
12
13
# File 'lib/computron/report.rb', line 11

def uri
  @uri
end

Instance Method Details

#durationObject



18
19
20
# File 'lib/computron/report.rb', line 18

def duration
  @duration ||= response.at.to_f - at.to_f if at and response.at
end