Sha256: 3107c69563bf714f2249f47af03556cc8d59c7efa8313264f7615a85b97b53b5

Contents?: true

Size: 833 Bytes

Versions: 25

Compression:

Stored size: 833 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 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

25 entries across 25 versions & 1 rubygems

Version Path
neo4j-core-7.2.1 lib/neo4j/core/relationship.rb
neo4j-core-7.2.0 lib/neo4j/core/relationship.rb
neo4j-core-7.1.2 lib/neo4j/core/relationship.rb
neo4j-core-7.0.9 lib/neo4j/core/relationship.rb
neo4j-core-7.1.1 lib/neo4j/core/relationship.rb
neo4j-core-7.1.0 lib/neo4j/core/relationship.rb
neo4j-core-7.0.8 lib/neo4j/core/relationship.rb
neo4j-core-7.0.7 lib/neo4j/core/relationship.rb
neo4j-core-7.0.6 lib/neo4j/core/relationship.rb
neo4j-core-7.0.5 lib/neo4j/core/relationship.rb
neo4j-core-7.0.4 lib/neo4j/core/relationship.rb
neo4j-core-7.0.3 lib/neo4j/core/relationship.rb
neo4j-core-7.0.2 lib/neo4j/core/relationship.rb
neo4j-core-7.0.1 lib/neo4j/core/relationship.rb
neo4j-core-7.0.0 lib/neo4j/core/relationship.rb
neo4j-core-7.0.0.rc.2 lib/neo4j/core/relationship.rb
neo4j-core-7.0.0.rc.1 lib/neo4j/core/relationship.rb
neo4j-core-7.0.0.alpha.8 lib/neo4j/core/relationship.rb
neo4j-core-7.0.0.alpha.7 lib/neo4j/core/relationship.rb
neo4j-core-7.0.0.alpha.6 lib/neo4j/core/relationship.rb