Class: Aerospike::GeoJSONValue
- Inherits:
-
Value
- Object
- Value
- Aerospike::GeoJSONValue
show all
- Defined in:
- lib/aerospike/value/value.rb
Overview
GeoJSON value. Supported by Aerospike server version 3.7 and later.
Instance Method Summary
collapse
Methods inherited from Value
get_packer, of, put_packer
Constructor Details
391
392
393
394
395
|
# File 'lib/aerospike/value/value.rb', line 391
def initialize(json)
@json = json
@bytes = json.to_json
self
end
|
Instance Method Details
#estimate_size ⇒ Object
397
398
399
400
|
# File 'lib/aerospike/value/value.rb', line 397
def estimate_size
1 + 2 + @bytes.bytesize
end
|
#get ⇒ Object
416
417
418
|
# File 'lib/aerospike/value/value.rb', line 416
def get
@json
end
|
#to_bytes ⇒ Object
420
421
422
|
# File 'lib/aerospike/value/value.rb', line 420
def to_bytes
@bytes
end
|
#to_s ⇒ Object
424
425
426
|
# File 'lib/aerospike/value/value.rb', line 424
def to_s
@json
end
|
#write(buffer, offset) ⇒ Object
402
403
404
405
406
|
# File 'lib/aerospike/value/value.rb', line 402
def write(buffer, offset)
buffer.write_byte(0, offset) buffer.write_uint16(0, offset + 1) return 1 + 2 + buffer.write_binary(@bytes, offset + 3) end
|