Sha256: 127b281f3f2667cbe818b921d299326420e4acc105b7f05f27e82e6a6fe5a850

Contents?: true

Size: 1.06 KB

Versions: 22

Compression:

Stored size: 1.06 KB

Contents

module Neo4j
  module Wrapper
    module RelationshipMixin
      module Initialize

        # Init this node with the specified java neo4j relationship.
        def init_on_load(java_rel)
          @_java_rel = java_rel
        end


        # Creates a new node and initialize with given properties.
        # You can override this to provide your own initialization.
        #
        # @param (see Neo4j::Wrapper::RelationshipMixin::ClassMethods#new)
        def init_on_create(rel_type, from_node, to_node, *props) # :nodoc:
          _java_entity[:_classname] = self.class.to_s
          if props.first.respond_to?(:each_pair)
            props.first.each_pair { |k, v| respond_to?("#{k}=") ? self.send("#{k}=", v) : @_java_rel[k] = v }
          end
        end

        # @returns [Neo4j::Relationship] the wrapped relationship object
        # @see http://rdoc.info/github/andreasronge/neo4j-core/master/Neo4j/Relationship Neo4j::Relationship
        def _java_rel
          @_java_rel
        end

        alias_method :_java_entity, :_java_rel

      end
    end
  end

end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
neo4j-wrapper-2.3.0-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-2.2.4-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-2.2.3-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-2.2.1-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-2.2.0-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-2.2.0.rc1-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-2.1.0-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-2.0.1-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-2.0.0-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-2.0.0.rc2-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-2.0.0.rc1-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-0.0.11-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-0.0.10-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-0.0.9-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-0.0.8-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-0.0.7-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-0.0.6-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-0.0.5-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-0.0.4-java lib/neo4j-wrapper/relationship_mixin/initialize.rb
neo4j-wrapper-0.0.3-java lib/neo4j-wrapper/relationship_mixin/initialize.rb