Module: ApacheAge::Entities::Path

Extended by:
ActiveSupport::Concern
Included in:
Path
Defined in:
lib/apache_age/entities/path.rb

Instance Method Summary collapse

Instance Method Details

#age_typeObject



11
# File 'lib/apache_age/entities/path.rb', line 11

def age_type = 'path'

#allObject



62
63
64
65
# File 'lib/apache_age/entities/path.rb', line 62

def all
  ensure_query_builder!
  @query_builder.all
end

#ensure_query_builder!Object



13
14
15
# File 'lib/apache_age/entities/path.rb', line 13

def ensure_query_builder!
  @query_builder ||= ApacheAge::Entities::QueryBuilder.new(self.class)
end

#executeObject

transforms the query and returns results



52
53
54
55
# File 'lib/apache_age/entities/path.rb', line 52

def execute
  ensure_query_builder!
  @query_builder.execute
end

#firstObject



57
58
59
60
# File 'lib/apache_age/entities/path.rb', line 57

def first
  ensure_query_builder!
  @query_builder.first
end

#limit(limit_value) ⇒ Object



39
40
41
42
43
# File 'lib/apache_age/entities/path.rb', line 39

def limit(limit_value)
  ensure_query_builder!
  @query_builder.limit(limit_value)
  self
end

#match(match_string) ⇒ Object



21
22
23
24
# File 'lib/apache_age/entities/path.rb', line 21

def match(match_string)
  @match_clause = match_string
  self
end

#match_clauseObject



17
18
19
# File 'lib/apache_age/entities/path.rb', line 17

def match_clause
  "path = (start_node)-[#{path_edge}#{path_length}#{path_properties}]->(end_node)"
end

#order(ordering) ⇒ Object



33
34
35
36
37
# File 'lib/apache_age/entities/path.rb', line 33

def order(ordering)
  ensure_query_builder!
  @query_builder.order(ordering)
  self
end

#return(*variables) ⇒ Object



45
46
47
48
49
# File 'lib/apache_age/entities/path.rb', line 45

def return(*variables)
  ensure_query_builder!
  @query_builder.return(*variables)
  self
end

#to_sqlObject



67
68
69
70
# File 'lib/apache_age/entities/path.rb', line 67

def to_sql
  ensure_query_builder!
  @query_builder.to_sql
end

#where(*args) ⇒ Object

Delegate additional methods like ‘where`, `limit`, etc., to `QueryBuilder`



27
28
29
30
31
# File 'lib/apache_age/entities/path.rb', line 27

def where(*args)
  ensure_query_builder!
  @query_builder.where(*args)
  self
end