lib/ksql/stream.rb
#
# Define a Struct class to fit the streaming data into.
#
# @param [Hash] schema Query schema
#
# @return [Ksql::Row] Stream event class
#
Define a Struct class to fit the streaming data into.
Define a Struct class to fit the streaming data into .
def build_event_class(schema)
        @id = schema['queryId']
        row_const = "Stream#{schema['queryId'].gsub('-', '_')}Row"
        Ksql.const_defined?(row_const) ? "Ksql::#{row_const}".constantize : Ksql.const_set(row_const, Class.new(Struct.new(*schema['columnNames'].map { |c| c.downcase.to_sym })))
      end
def build_event_class ( schema ) @id = schema [ 'queryId' ] row_const = "Stream#{schema['queryId'].gsub('-', '_')}Row" Ksql . const_defined? ( row_const ) ? "Ksql::#{row_const}" . constantize : Ksql . const_set ( row_const , Class . new ( Struct . new ( * schema [ 'columnNames' ] . map { | c | c . downcase . to_sym } ) ) ) end
Define a Struct class to fit the streaming data into.
Define a Struct class to fit the streaming data into .
Stream event class
Stream event class
Ksql::Row
schema
schema Query schema
schema Query schema