Class: SeeingIsBelieving::EventStream::Events::MaxLineCaptures

Inherits:
SeeingIsBelieving::EventStream::Event
  • Object
show all
Defined in:
lib/seeing_is_believing/event_stream/events.rb

Overview

The program will not record more results than this for a line. Note that if this is hit, it will emit an unrecorded_result.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.event_nameObject



39
40
41
# File 'lib/seeing_is_believing/event_stream/events.rb', line 39

def self.event_name
  :max_line_captures
end

Instance Method Details

#as_jsonObject



42
43
44
45
46
47
48
49
# File 'lib/seeing_is_believing/event_stream/events.rb', line 42

def as_json
  value, is_infinity = if self.value == Float::INFINITY
                         [-1, true]
                       else
                         [self.value, false]
                       end
  [event_name, {value: value, is_infinity: is_infinity}]
end