Class: Trifle::Logs::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/trifle/logs/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_locObject (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_locObject (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

#dataObject



18
19
20
# File 'lib/trifle/logs/result.rb', line 18

def data
  meta.dig('data', 'stats', 'matches').to_i.positive? ? @lines[1..-3] : []
end

#metaObject



14
15
16
# File 'lib/trifle/logs/result.rb', line 14

def meta
  @lines.last || {}
end