ClassMethods

Constants

Methods

#_type

When called without arguments, it will return the current setting or supply a default. When called with arguments, it will change the current setting. should be deprecated

def type(given_type = nil, auto = false)
  case
  when !given_type && rel_type?
    @rel_type
  when given_type
    assign_type!(given_type, auto)
  else
    assign_type!(namespaced_model_name, true)
  end
end

#_wrapped_classes

def _wrapped_classes
  Neo4j::ActiveRel::Types::WRAPPED_CLASSES
end

#add_wrapped_class

def add_wrapped_class(type)
  # _wrapped_classes[type.to_sym.downcase] = self.name
  _wrapped_classes[type.to_sym] = self.name
end

#decorated_rel_type

def decorated_rel_type(type)
  @decorated_rel_type ||= Neo4j::Shared::RelTypeConverters.decorated_rel_type(type)
end

#inherited

def inherited(subclass)
  subclass.type subclass.namespaced_model_name, true
end

#namespaced_model_name

def namespaced_model_name
  case Neo4j::Config[:module_handling]
  when :demodulize
    self.name.demodulize
  when Proc
    Neo4j::Config[:module_handling].call(self.name)
  else
    self.name
  end
end
#rel_type

When called without arguments, it will return the current setting or supply a default. When called with arguments, it will change the current setting.

def type(given_type = nil, auto = false)
  case
  when !given_type && rel_type?
    @rel_type
  when given_type
    assign_type!(given_type, auto)
  else
    assign_type!(namespaced_model_name, true)
  end
end

#rel_type?

def rel_type?
  !!@rel_type
end
#type

When called without arguments, it will return the current setting or supply a default. When called with arguments, it will change the current setting.

def type(given_type = nil, auto = false)
  case
  when !given_type && rel_type?
    @rel_type
  when given_type
    assign_type!(given_type, auto)
  else
    assign_type!(namespaced_model_name, true)
  end
end