Sha256: 5061ef54713b047caf80a4cf76cc94e5b98a5fe22fa0b72b3aa1bebf4b039b79

Contents?: true

Size: 522 Bytes

Versions: 7

Compression:

Stored size: 522 Bytes

Contents

require 'logger'
require 'rflow-components-http'

RFlow.logger = Logger.new STDOUT
RFlow.logger.level = 5

def decode_avro(schema_string, serialized_object)
  schema = Avro::Schema.parse(schema_string)
  Avro::IO::DatumReader.new(schema, schema).read Avro::IO::BinaryDecoder.new(StringIO.new(serialized_object))
end

def encode_avro(schema_string, object)
  schema = Avro::Schema.parse(schema_string)
  sio = StringIO.new
  Avro::IO::DatumWriter.new(schema).write object, Avro::IO::BinaryEncoder.new(sio)
  sio.string
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rflow-components-http-2.0.0 spec/spec_helper.rb
rflow-components-http-1.1.1 spec/spec_helper.rb
rflow-components-http-1.1.0 spec/spec_helper.rb
rflow-components-http-1.0.1 spec/spec_helper.rb
rflow-components-http-1.0.0 spec/spec_helper.rb
rflow-components-http-1.0.0a4 spec/spec_helper.rb
rflow-components-http-1.0.0a3 spec/spec_helper.rb