ClassMethods

Constants

Methods

#attributes_nil_hash

an extra call to a slow dependency method.

def attributes_nil_hash
  declared_properties.attributes_nil_hash
end

#build_property

def build_property(name, options)
  DeclaredProperty.new(name, options).tap do |prop|
    prop.register
    declared_properties.register(prop)
    yield name
    constraint_or_index(name, options)
  end
end

#declared_properties

def declared_properties
  @_declared_properties ||= DeclaredProperties.new(self)
end

#extract_association_attributes!

def extract_association_attributes!(props)
  props
end

#inherit_property

def inherit_property(name, attr_def, options = {})
  build_property(name, options) do |prop_name|
    attributes[prop_name] = attr_def
  end
end
#property

Defines a property on the class

See active_attr gem for allowed options, e.g which type Notice, in Neo4j you don’t have to declare properties before using them, see the neo4j-core api.

def property(name, options = {})
  build_property(name, options) do |prop|
    attribute(prop)
  end
end

#undef_property

def undef_property(name)
  undef_constraint_or_index(name)
  declared_properties.unregister(name)
  attribute_methods(name).each { |method| undef_method(method) }
end