Module: Neo4j::Embedded::Property
Constant Summary
PropertyValidator::VALID_PROPERTY_VALUE_CLASSES
Instance Method Summary
collapse
tx_methods
#valid_property?, #validate_property
Instance Method Details
#[](key) ⇒ Object
14
15
16
17
18
|
# File 'lib/neo4j-embedded/property.rb', line 14
def [](key)
return nil unless has_property?(key.to_s)
to_ruby_property(key.to_s)
end
|
#[]=(k, v) ⇒ Object
Sets the property of this node. Property keys are always strings. Valid property value types are the primitives: (String
, Fixnum
, Float
, FalseClass
, TrueClass
) or an array of those primitives.
Gotchas
32
33
34
|
# File 'lib/neo4j-embedded/property.rb', line 32
def []=(k, v)
to_java_property(k, v)
end
|
#_update_props(hash) ⇒ Object
53
54
55
|
# File 'lib/neo4j-embedded/property.rb', line 53
def _update_props(hash)
hash.each { |k, v| to_java_property(k, v) }
end
|
#neo_id ⇒ Object
62
63
64
|
# File 'lib/neo4j-embedded/property.rb', line 62
def neo_id
get_id
end
|
#props ⇒ Object
37
38
39
40
41
|
# File 'lib/neo4j-embedded/property.rb', line 37
def props
property_keys.each_with_object({}) do |key, ret|
ret[key.to_sym] = to_ruby_property(key)
end
end
|
#props=(hash) ⇒ Object
44
45
46
47
48
49
50
|
# File 'lib/neo4j-embedded/property.rb', line 44
def props=(hash)
property_keys.each do |key|
remove_property(key)
end
_update_props(hash)
hash
end
|
#refresh ⇒ Object
66
67
68
|
# File 'lib/neo4j-embedded/property.rb', line 66
def refresh
end
|
#update_props(hash) ⇒ Object
57
58
59
|
# File 'lib/neo4j-embedded/property.rb', line 57
def update_props(hash)
_update_props(hash)
end
|