Class: Loaderio::Test

Inherits:
Base
  • Object
show all
Defined in:
lib/loaderio/test.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#errors, #message

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

all, create, find, #valid?

Constructor Details

#initialize(attributes) ⇒ Test

Returns a new instance of Test.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/loaderio/test.rb', line 5

def initialize(attributes)
  @url          = attributes[:url]
  @name         = attributes[:name]
  @duration     = attributes[:duration]
  @timeout      = attributes[:timeout]
  @from         = attributes[:from]
  @to           = attributes[:to]
  @status       = attributes[:status]
  @test_id      = attributes[:test_id]
  @request_type = attributes[:request_type]
  @results_data = OpenStruct.new(attributes[:results_data])
  super
end

Instance Attribute Details

#durationObject (readonly)

Returns the value of attribute duration.



3
4
5
# File 'lib/loaderio/test.rb', line 3

def duration
  @duration
end

#fromObject (readonly)

Returns the value of attribute from.



3
4
5
# File 'lib/loaderio/test.rb', line 3

def from
  @from
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/loaderio/test.rb', line 3

def name
  @name
end

#request_typeObject (readonly)

Returns the value of attribute request_type.



3
4
5
# File 'lib/loaderio/test.rb', line 3

def request_type
  @request_type
end

#results_dataObject (readonly)

Returns the value of attribute results_data.



3
4
5
# File 'lib/loaderio/test.rb', line 3

def results_data
  @results_data
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/loaderio/test.rb', line 3

def status
  @status
end

#test_idObject (readonly)

Returns the value of attribute test_id.



3
4
5
# File 'lib/loaderio/test.rb', line 3

def test_id
  @test_id
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



3
4
5
# File 'lib/loaderio/test.rb', line 3

def timeout
  @timeout
end

#toObject (readonly)

Returns the value of attribute to.



3
4
5
# File 'lib/loaderio/test.rb', line 3

def to
  @to
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/loaderio/test.rb', line 3

def url
  @url
end

Class Method Details

.resource_nameObject



19
20
21
# File 'lib/loaderio/test.rb', line 19

def self.resource_name
  "tests"
end

.results(id) ⇒ Object



23
24
25
# File 'lib/loaderio/test.rb', line 23

def self.results(id)
  new(parse(Loaderio::Configuration.resource["#{resource_name}/#{id}/results"].get))
end