Class: Aspen::CustomStatement

Inherits:
AbstractStatement show all
Defined in:
lib/aspen/custom_statement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nodes:, cypher:) ⇒ CustomStatement

TODO:

The inclusion of the Cypher parameter suggests that there might be a better way to generate the Cypher from a custom statement. Not sure.

Returns a new instance of CustomStatement.

Parameters:

  • nodes (Array<Aspen::Node>)

    a list of nodes

  • cypher (String)

    the Cypher generated by the template by the compiler



26
27
28
29
# File 'lib/aspen/custom_statement.rb', line 26

def initialize(nodes: , cypher: )
  @nodes  = nodes
  @cypher = cypher
end

Instance Attribute Details

#nodesObject (readonly)

Returns the value of attribute nodes.



8
9
10
# File 'lib/aspen/custom_statement.rb', line 8

def nodes
  @nodes
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/aspen/custom_statement.rb', line 8

def type
  @type
end

Instance Method Details

#signatureObject

TODO:

The signature of the custom statement should be the Cypher template for that statement.



16
17
18
# File 'lib/aspen/custom_statement.rb', line 16

def signature
  "custom"
end

#to_cypherObject



31
32
33
# File 'lib/aspen/custom_statement.rb', line 31

def to_cypher
  @cypher
end