Sha256: f720b075c168e4f68dbc9234f86762dd4b9e21874be87852edbe9489a6b6e3ce

Contents?: true

Size: 675 Bytes

Versions: 48

Compression:

Stored size: 675 Bytes

Contents

class Neo4j::Relationship
  module Wrapper
    def wrapper
      props.symbolize_keys!
      begin
        most_concrete_class = sorted_wrapper_classes
        wrapped_rel = most_concrete_class.constantize.new
      rescue NameError
        return self
      end

      wrapped_rel.init_on_load(self, self._start_node_id, self._end_node_id, self.rel_type)
      wrapped_rel
    end

    private

    def sorted_wrapper_classes
      props[Neo4j::Config.class_name_property] || class_from_type
    end

    def class_from_type
      Neo4j::ActiveRel::Types::WRAPPED_CLASSES[rel_type] || Neo4j::ActiveRel::Types::WRAPPED_CLASSES[rel_type] = rel_type.camelize
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
neo4j-5.2.15 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-5.2.14 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-6.0.0.alpha.11 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-6.0.0.alpha.9 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-5.2.13 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-5.2.12 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-6.0.0.alpha.8 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-6.0.0.alpha.7 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-5.2.11 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-6.0.0.alpha.5 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-6.0.0.alpha.4 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-5.2.10 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-6.0.0.alpha.3 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-6.0.0.alpha.2 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-6.0.0.alpha.1 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-5.2.9 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-5.2.8 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-5.2.7 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-5.2.6 lib/neo4j/active_rel/rel_wrapper.rb
neo4j-5.2.5 lib/neo4j/active_rel/rel_wrapper.rb