Class: RTrail::Run

Inherits:
Entity show all
Includes:
Helpers::HasCreateTime, Methods::Close, Methods::Delete, Methods::Get, Methods::Update
Defined in:
lib/rtrail/run.rb

Instance Attribute Summary

Attributes inherited from Entity

#data

Instance Method Summary collapse

Methods included from Helpers::HasCreateTime

#create_time

Methods included from Methods::Close

#close

Methods included from Methods::Delete

#delete

Methods included from Methods::Update

#update

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

#complete_timeObject



34
35
36
37
# File 'lib/rtrail/run.rb', line 34

def complete_time
  return nil if !completed?
  return Time.at(self[:completed_on].to_i).utc
end

#completed?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/rtrail/run.rb', line 39

def completed?
  return !self[:completed_on].nil?
end

#summaryObject

Return a one-line summary of this Run



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rtrail/run.rb', line 15

def summary
  # TODO: Include these?
  # self.untested_count
  # self.blocked_count
  # self.passed_count
  # self.failed_count
  result = "#{self.id}: #{self.name}"
  if self.completed?
    result += " [completed #{self.complete_time}]"
  else
    result += " [not completed]"
  end
  return result
end

#testsObject



30
31
32
# File 'lib/rtrail/run.rb', line 30

def tests
  return get_entities(Test, data.id)
end