Class: Oso::Polar::QueryEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/oso/polar/query_event.rb

Overview

A query event received across the FFI boundary.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_data) ⇒ QueryEvent #initialize(event_data) ⇒ QueryEvent

Returns a new instance of QueryEvent.

Overloads:

  • #initialize(event_data) ⇒ QueryEvent

    Parameters:

    • event_data (Hash<String, Object>)
  • #initialize(event_data) ⇒ QueryEvent

    Parameters:

    • event_data (String)


16
17
18
19
# File 'lib/oso/polar/query_event.rb', line 16

def initialize(event_data)
  event_data = { event_data => nil } if event_data == 'Done'
  @kind, @data = event_data.first
end

Instance Attribute Details

#dataHash<String, Object> (readonly)

Returns:

  • (Hash<String, Object>)


10
11
12
# File 'lib/oso/polar/query_event.rb', line 10

def data
  @data
end

#kindString (readonly)

Returns:

  • (String)


8
9
10
# File 'lib/oso/polar/query_event.rb', line 8

def kind
  @kind
end