class TestQueue::Stats::Suite

Attributes

duration[R]
last_seen_at[R]
name[R]
path[R]

Public Class Methods

from_hash(hash) click to toggle source
# File lib/test_queue/stats.rb, line 28
def self.from_hash(hash)
  self.new(hash.fetch(:name),
           hash.fetch(:path),
           hash.fetch(:duration),
           Time.at(hash.fetch(:last_seen_at)))
end
new(name, path, duration, last_seen_at) click to toggle source
# File lib/test_queue/stats.rb, line 6
def initialize(name, path, duration, last_seen_at)
  @name = name
  @path = path
  @duration = duration
  @last_seen_at = last_seen_at

  freeze
end

Public Instance Methods

==(other) click to toggle source
# File lib/test_queue/stats.rb, line 15
def ==(other)
  other &&
    name == other.name &&
    path == other.path &&
    duration == other.duration &&
    last_seen_at == other.last_seen_at
end
Also aliased as: eql?
eql?(other)
Alias for: ==
to_h() click to toggle source
# File lib/test_queue/stats.rb, line 24
def to_h
  { :name => name, :path => path, :duration => duration, :last_seen_at => last_seen_at.to_i }
end