module Neo4j::ActiveNode::IdProperty::Accessor::ClassMethods

Public Instance Methods

default_properties() click to toggle source

@return [Hash<Symbol,Proc>]

   # File lib/neo4j/active_node/id_property/accessor.rb
38 def default_properties
39   @default_property ||= {}
40 end
default_properties_keys() click to toggle source
   # File lib/neo4j/active_node/id_property/accessor.rb
42 def default_properties_keys
43   @default_properties_keys ||= default_properties.keys
44 end
default_property(name, &block) click to toggle source

TODO: Move this to the DeclaredProperties

   # File lib/neo4j/active_node/id_property/accessor.rb
32 def default_property(name, &block)
33   reset_default_properties(name) if default_properties.respond_to?(:size)
34   default_properties[name] = block
35 end
default_property_key() click to toggle source
   # File lib/neo4j/active_node/id_property/accessor.rb
27 def default_property_key
28   @default_property_key ||= default_properties_keys.first
29 end
default_property_values(instance) click to toggle source
   # File lib/neo4j/active_node/id_property/accessor.rb
55 def default_property_values(instance)
56   default_properties.each_with_object({}) do |(key, block), result|
57     result[key] = block.call(instance)
58   end
59 end
reset_default_properties(name_to_keep) click to toggle source
   # File lib/neo4j/active_node/id_property/accessor.rb
46 def reset_default_properties(name_to_keep)
47   default_properties.each_key do |property|
48     @default_properties_keys = nil
49     undef_method(property) unless property == name_to_keep
50   end
51   @default_properties_keys = nil
52   @default_property = {}
53 end