Class: ApacheAge::Node
Class Method Summary
collapse
Instance Method Summary
collapse
-
#display ⇒ Object
def display = [label, properties&.values&.first].compact.join(‘ - ’).
#age_type, #create_sql, #update_sql
Class Method Details
.age_type ⇒ Object
16
|
# File 'lib/apache_age/node.rb', line 16
def age_type = 'vertex'
|
.all ⇒ Object
68
69
70
71
|
# File 'lib/apache_age/node.rb', line 68
def all
ensure_query_builder!
@query_builder.all
end
|
.cypher(node_class: nil, graph_name: nil) ⇒ Object
22
23
24
25
26
|
# File 'lib/apache_age/node.rb', line 22
def cypher(node_class: nil, graph_name: nil)
@node_class = node_class || self
@query_builder = ApacheAge::Entities::QueryBuilder.new(@node_class, graph_name:)
self
end
|
.ensure_query_builder! ⇒ Object
.execute ⇒ Object
58
59
60
61
|
# File 'lib/apache_age/node.rb', line 58
def execute
ensure_query_builder!
@query_builder.execute
end
|
.first ⇒ Object
63
64
65
66
|
# File 'lib/apache_age/node.rb', line 63
def first
ensure_query_builder!
@query_builder.first
end
|
.limit(limit_value) ⇒ Object
46
47
48
49
50
|
# File 'lib/apache_age/node.rb', line 46
def limit(limit_value)
ensure_query_builder!
@query_builder.limit(limit_value)
self
end
|
.match(match_string) ⇒ Object
28
29
30
31
32
|
# File 'lib/apache_age/node.rb', line 28
def match(match_string)
ensure_query_builder!
@query_builder.match(match_string)
self
end
|
.order(ordering) ⇒ Object
40
41
42
43
44
|
# File 'lib/apache_age/node.rb', line 40
def order(ordering)
ensure_query_builder!
@query_builder.order(ordering)
self
end
|
.return(*variables) ⇒ Object
52
53
54
55
56
|
# File 'lib/apache_age/node.rb', line 52
def return(*variables)
ensure_query_builder!
@query_builder.return(*variables)
self
end
|
.to_sql ⇒ Object
73
74
75
76
|
# File 'lib/apache_age/node.rb', line 73
def to_sql
ensure_query_builder!
@query_builder.to_sql
end
|
.where(*args) ⇒ Object
34
35
36
37
38
|
# File 'lib/apache_age/node.rb', line 34
def where(*args)
ensure_query_builder!
@query_builder.where(*args)
self
end
|
Instance Method Details
#display ⇒ Object
def display = [label, properties&.values&.first].compact.join(‘ - ’)
10
11
12
13
|
# File 'lib/apache_age/node.rb', line 10
def display
info = properties&.values&.first
info.blank? ? "#{label} (#{id})" : "#{info} (#{label})"
end
|