Class: RTrail::Test

Inherits:
Entity show all
Includes:
Methods::Get
Defined in:
lib/rtrail/test.rb

Instance Attribute Summary

Attributes inherited from Entity

#data

Instance Method Summary collapse

Methods included from Methods::Get

included

Methods inherited from Entity

#add_entity, basename, client, #client, client=, #get_entities, #initialize, #method_missing

Methods included from Helpers

included, #is_id?, #path_with_params

Constructor Details

This class inherits a constructor from RTrail::Entity

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RTrail::Entity

Instance Method Details

#add_result(fields) ⇒ Object

Add a new Result to this test.



20
21
22
# File 'lib/rtrail/test.rb', line 20

def add_result(fields)
  return add_entity(Result, data.id, fields)
end

#latest_resultObject

Return the most recently created Result for this Test.



15
16
17
# File 'lib/rtrail/test.rb', line 15

def latest_result
  return get_entities(Result, data.id, :limit => 1).first
end

#resultsObject

Return all Results for this Test.



10
11
12
# File 'lib/rtrail/test.rb', line 10

def results
  return get_entities(Result, data.id)
end