Class: Aerospike::PredExp::StringValue

Inherits:
Aerospike::PredExp show all
Defined in:
lib/aerospike/query/pred_exp/string_value.rb

Constant Summary

Constants inherited from Aerospike::PredExp

AND, GEOJSON_BIN, GEOJSON_CONTAINS, GEOJSON_VALUE, GEOJSON_VAR, GEOJSON_WITHIN, INTEGER_BIN, INTEGER_EQUAL, INTEGER_GREATER, INTEGER_GREATEREQ, INTEGER_LESS, INTEGER_LESSEQ, INTEGER_UNEQUAL, INTEGER_VALUE, INTEGER_VAR, LAST_UPDATE, LIST_BIN, LIST_ITERATE_AND, LIST_ITERATE_OR, MAPKEY_ITERATE_AND, MAPKEY_ITERATE_OR, MAPVAL_ITERATE_AND, MAPVAL_ITERATE_OR, MAP_BIN, NOT, OR, RECSIZE, STRING_BIN, STRING_EQUAL, STRING_REGEX, STRING_UNEQUAL, STRING_VALUE, STRING_VAR, VOID_TIME

Instance Method Summary collapse

Methods inherited from Aerospike::PredExp

and, estimate_size, geojson_bin, geojson_contains, geojson_value, geojson_var, geojson_within, integer_bin, integer_equal, integer_greater, integer_greater_eq, integer_less, integer_less_eq, integer_unequal, integer_value, integer_var, last_update, list_bin, list_iterate_and, list_iterate_or, map_bin, mapkey_iterate_and, mapkey_iterate_or, mapval_iterate_and, mapval_iterate_or, not, or, record_size, string_bin, string_equal, string_regex, string_unequal, string_value, string_var, void_time, write

Constructor Details

#initialize(value, type) ⇒ StringValue

Returns a new instance of StringValue.



6
7
8
9
# File 'lib/aerospike/query/pred_exp/string_value.rb', line 6

def initialize(value, type)
  @value = value
  @type = type
end

Instance Method Details

#estimate_sizeObject



11
12
13
# File 'lib/aerospike/query/pred_exp/string_value.rb', line 11

def estimate_size
  @value.bytesize + 6
end

#write(buffer, offset) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/aerospike/query/pred_exp/string_value.rb', line 15

def write(buffer, offset)
  buffer.write_int16(@type, offset)
  offset += 2

  buffer.write_int32(@value.bytesize, offset)
  offset += 4

  len = buffer.write_binary(@value, offset)
  offset += len

  offset
end