Module: ActiveGraph::Node::IdProperty::TypeMethods

Extended by:
TypeMethods
Included in:
TypeMethods
Defined in:
lib/active_graph/node/id_property.rb

Instance Method Summary collapse

Instance Method Details

#define_id_methods(clazz, name, conf) ⇒ Object


40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/active_graph/node/id_property.rb', line 40

def define_id_methods(clazz, name, conf)
  return if name == :neo_id

  validate_conf!(conf)

  if conf[:on]
    define_custom_method(clazz, name, conf[:on])
  elsif conf[:auto]
    define_uuid_method(clazz, name)
  elsif conf.empty?
    define_property_method(clazz, name)
  end
end