Sha256: b1e7785e6df00eb00207e6d3cb15e46192b460d999ff0fa37ec6d0cdc1963ba8

Contents?: true

Size: 917 Bytes

Versions: 15

Compression:

Stored size: 917 Bytes

Contents

require 'neo4j/core/wrappable'
require 'active_support/core_ext/hash/keys'

module Neo4j
  module Core
    class Relationship
      attr_reader :id, :type, :properties, :start_node_id, :end_node_id
      alias props properties
      alias neo_id id
      alias start_node_neo_id start_node_id
      alias end_node_neo_id end_node_id
      alias rel_type type

      include Wrappable

      def initialize(id, type, properties, start_node_id = nil, end_node_id = nil)
        @id = id
        @type = type.to_sym unless type.nil?
        @properties = properties.symbolize_keys
        @start_node_id = start_node_id
        @end_node_id = end_node_id
      end

      class << self
        def from_url(url, properties = {})
          id = url.split('/')[-1].to_i
          type = nil # unknown
          properties = properties

          new(id, type, properties, nil, nil)
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
neo4j-core-9.0.0 lib/neo4j/core/relationship.rb
neo4j-core-9.0.0.alpha.1 lib/neo4j/core/relationship.rb
neo4j-core-8.1.4 lib/neo4j/core/relationship.rb
neo4j-core-8.1.3 lib/neo4j/core/relationship.rb
neo4j-core-8.1.2 lib/neo4j/core/relationship.rb
neo4j-core-8.1.1 lib/neo4j/core/relationship.rb
neo4j-core-8.1.0 lib/neo4j/core/relationship.rb
neo4j-core-8.0.4 lib/neo4j/core/relationship.rb
neo4j-core-8.0.3 lib/neo4j/core/relationship.rb
neo4j-core-8.0.2 lib/neo4j/core/relationship.rb
neo4j-core-8.0.1 lib/neo4j/core/relationship.rb
neo4j-core-7.2.4 lib/neo4j/core/relationship.rb
neo4j-core-8.0.0 lib/neo4j/core/relationship.rb
neo4j-core-7.2.3 lib/neo4j/core/relationship.rb
neo4j-core-7.2.2 lib/neo4j/core/relationship.rb