Class: Trifle::Logs::Result
- Inherits:
-
Object
- Object
- Trifle::Logs::Result
- Defined in:
- lib/trifle/logs/result.rb
Instance Attribute Summary collapse
-
#max_loc ⇒ Object
readonly
Returns the value of attribute max_loc.
-
#min_loc ⇒ Object
readonly
Returns the value of attribute min_loc.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(lines = [], min_loc: nil, max_loc: nil) ⇒ Result
constructor
A new instance of Result.
- #meta ⇒ Object
Constructor Details
#initialize(lines = [], min_loc: nil, max_loc: nil) ⇒ Result
Returns a new instance of Result.
8 9 10 11 12 |
# File 'lib/trifle/logs/result.rb', line 8 def initialize(lines = [], min_loc: nil, max_loc: nil) @lines = lines @min_loc = min_loc @max_loc = max_loc end |
Instance Attribute Details
#max_loc ⇒ Object (readonly)
Returns the value of attribute max_loc.
6 7 8 |
# File 'lib/trifle/logs/result.rb', line 6 def max_loc @max_loc end |
#min_loc ⇒ Object (readonly)
Returns the value of attribute min_loc.
6 7 8 |
# File 'lib/trifle/logs/result.rb', line 6 def min_loc @min_loc end |
Instance Method Details
#data ⇒ Object
18 19 20 |
# File 'lib/trifle/logs/result.rb', line 18 def data .dig('data', 'stats', 'matches').to_i.positive? ? @lines[1..-3] : [] end |
#meta ⇒ Object
14 15 16 |
# File 'lib/trifle/logs/result.rb', line 14 def @lines.last || {} end |