Class: TestQueue::Stats::Suite
- Inherits:
-
Object
- Object
- TestQueue::Stats::Suite
- Defined in:
- lib/test_queue/stats.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#last_seen_at ⇒ Object
readonly
Returns the value of attribute last_seen_at.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
-
#initialize(name, path, duration, last_seen_at) ⇒ Suite
constructor
A new instance of Suite.
- #to_h ⇒ Object
Constructor Details
#initialize(name, path, duration, last_seen_at) ⇒ Suite
Returns a new instance of Suite.
8 9 10 11 12 13 14 15 |
# File 'lib/test_queue/stats.rb', line 8 def initialize(name, path, duration, last_seen_at) @name = name @path = path @duration = duration @last_seen_at = last_seen_at freeze end |
Instance Attribute Details
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
6 7 8 |
# File 'lib/test_queue/stats.rb', line 6 def duration @duration end |
#last_seen_at ⇒ Object (readonly)
Returns the value of attribute last_seen_at.
6 7 8 |
# File 'lib/test_queue/stats.rb', line 6 def last_seen_at @last_seen_at end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/test_queue/stats.rb', line 6 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/test_queue/stats.rb', line 6 def path @path end |
Class Method Details
.from_hash(hash) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/test_queue/stats.rb', line 30 def self.from_hash(hash) new(hash.fetch(:name), hash.fetch(:path), hash.fetch(:duration), Time.at(hash.fetch(:last_seen_at))) end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
17 18 19 20 21 22 23 |
# File 'lib/test_queue/stats.rb', line 17 def ==(other) other && name == other.name && path == other.path && duration == other.duration && last_seen_at == other.last_seen_at end |
#to_h ⇒ Object
26 27 28 |
# File 'lib/test_queue/stats.rb', line 26 def to_h { name: name, path: path, duration: duration, last_seen_at: last_seen_at.to_i } end |