Class: ROM::Neo4j::Dataset

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/rom/neo4j/dataset.rb

Overview

A dataset represents a collection returned from a query traversal over a sub-graph.

Datasets are Enumerable objects and can be manipulated using the standard methods, `each`, `map`, `inject`, and so forth.

Instance Method Summary collapse

Constructor Details

#initialize(query) ⇒ Dataset

Returns a new instance of Dataset.

Parameters:

See Also:



13
14
15
# File 'lib/rom/neo4j/dataset.rb', line 13

def initialize(query)
  @query = query
end

Instance Method Details

#each(&iter) ⇒ Object



26
27
28
# File 'lib/rom/neo4j/dataset.rb', line 26

def each(&iter)
  @query.each(&iter)
end

#limit(*conditions) ⇒ Object



46
47
48
# File 'lib/rom/neo4j/dataset.rb', line 46

def limit(*conditions)
  self.class.new(@query.limit(*conditions))
end

#match(*conditions) ⇒ Object



38
39
40
# File 'lib/rom/neo4j/dataset.rb', line 38

def match(*conditions)
  self.class.new(@query.match(*conditions))
end

#merge(*conditions) ⇒ Object



50
51
52
# File 'lib/rom/neo4j/dataset.rb', line 50

def merge(*conditions)
  self.class.new(@query.merge(*conditions))
end

#optional_match(*conditions) ⇒ Object



58
59
60
# File 'lib/rom/neo4j/dataset.rb', line 58

def optional_match(*conditions)
  self.class.new(@query.optional_match(*conditions))
end

#order(*conditions) ⇒ Object



54
55
56
# File 'lib/rom/neo4j/dataset.rb', line 54

def order(*conditions)
  self.class.new(@query.order(*conditions))
end

#params(*conditions) ⇒ Object



62
63
64
# File 'lib/rom/neo4j/dataset.rb', line 62

def params(*conditions)
  self.class.new(@query.params(*conditions))
end

#return(*conditions) ⇒ Object



42
43
44
# File 'lib/rom/neo4j/dataset.rb', line 42

def return(*conditions)
  self.class.new(@query.return(*conditions))
end

#sessionNeo4j::Session

Returns:

  • (Neo4j::Session)


18
19
20
# File 'lib/rom/neo4j/dataset.rb', line 18

def session
  @query.session
end

#start(*conditions) ⇒ Object



34
35
36
# File 'lib/rom/neo4j/dataset.rb', line 34

def start(*conditions)
  self.class.new(@query.start(*conditions))
end

#to_cypherObject



22
23
24
# File 'lib/rom/neo4j/dataset.rb', line 22

def to_cypher
  @query.to_cypher
end

#where(*conditions) ⇒ Object



30
31
32
# File 'lib/rom/neo4j/dataset.rb', line 30

def where(*conditions)
  self.class.new(@query.where(*conditions))
end