Class: TriCoreDB::StreamEntry

Inherits:
Struct
  • Object
show all
Defined in:
lib/tricoredb/response.rb

Overview

One entry of a cache stream.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fields ⇒ Object

Returns the value of attribute fields

Returns:

  • (Object) —

    the current value of fields



39
40
41
# File 'lib/tricoredb/response.rb', line 39

def fields
  @fields
end

#id ⇒ Object

Returns the value of attribute id

Returns:

  • (Object) —

    the current value of id



39
40
41
# File 'lib/tricoredb/response.rb', line 39

def id
  @id
end

Instance Method Details

#text ⇒ Hash{String => String}

Returns fields decoded as UTF-8, for the all-text case.

Returns:

  • (Hash{String => String}) —

    fields decoded as UTF-8, for the all-text case



41
42
43
# File 'lib/tricoredb/response.rb', line 41

def text
  fields.to_h { |f, v| [f.dup.force_encoding(Encoding::UTF_8), v.dup.force_encoding(Encoding::UTF_8)] }
end