Class: Cyrel::Clause::Skip
Overview
Represents a SKIP clause in a Cypher query.
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
Instance Method Summary collapse
-
#initialize(amount) ⇒ Skip
constructor
Initializes a SKIP clause.
-
#render(query) ⇒ String
Renders the SKIP clause.
-
#replace!(other_skip) ⇒ Object
Merging SKIP typically replaces the existing value.
Constructor Details
#initialize(amount) ⇒ Skip
Initializes a SKIP clause.
13 14 15 16 17 |
# File 'lib/cyrel/clause/skip.rb', line 13 def initialize(amount) @amount = Expression.coerce(amount) # Could add validation here to ensure the expression likely returns an integer, # but Cypher itself will handle runtime errors. end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
7 8 9 |
# File 'lib/cyrel/clause/skip.rb', line 7 def amount @amount end |
Instance Method Details
#render(query) ⇒ String
Renders the SKIP clause.
22 23 24 |
# File 'lib/cyrel/clause/skip.rb', line 22 def render(query) "SKIP #{@amount.render(query)}" end |
#replace!(other_skip) ⇒ Object
Merging SKIP typically replaces the existing value.
28 29 30 31 |
# File 'lib/cyrel/clause/skip.rb', line 28 def replace!(other_skip) @amount = other_skip.amount self end |