Encapsulates a vertex-property complex value. The name of the property is stored in the owning Vertex. This object contains a simple property value and any meta-properties that go with it.

VertexProperty’s are created when creating a Vertex object out of a graph query result hash. Access to meta-properties is done via the #properties attribute, but there is also a short-cut using array/hash dereference syntax:

Examples:
val = vp.properties['meta1']
# is the same as
val = vp['meta1']
Specifications:
VertexProperty should process property hash
p = VertexProperty.new(vertex_property_blob('prop1', 'val1'))
expect(p.value).to eq('val1')
expect(p.id['out_vertex']['community_id']).to eq(12345)
expect(p.properties['name']).to be_nil
expect(p['name']).to be_nil
VertexProperty should process meta-property hash
p = VertexProperty.new(vertex_property_blob('prop1', 'val1', properties: {k1: 'v1', k2: 'v2'}))
expect(p.value).to eq('val1')
expect(p.id['out_vertex']['community_id']).to eq(12345)
expect(p.properties['name']).to be_nil
expect(p.properties['k1']).to eq('v1')
expect(p['k1']).to eq('v1')
expect(p['k2']).to eq('v2')

Inherits

Object

Methods

id

Returns id of this property

Returns:
Type Details
Hash id of this property

value

Returns value of this property

Returns:
Type Details
String value of this property

properties

Returns meta-properties of this property

Returns:
Type Details
Hash<String, String> meta-properties of this property