Class: GraphWeaver::Codegen::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/graph_weaver/codegen/nodes.rb

Overview

Protocol defaults — subclasses override what differs. The full node protocol: bare_type, prop_type, cast(expr, depth), identity?, serialize(expr, depth), serialize_identity?, coerce?, coerce(expr), coerce_input_type, hash_coerce(expr, depth), hash_coerce_identity?, non_null?, nested.

Instance Method Summary collapse

Instance Method Details

#bare_typeObject

Raises:



16
# File 'lib/graph_weaver/codegen/nodes.rb', line 16

def bare_type = raise(GraphWeaver::Error, "#{self.class} must define bare_type")

#coerce?Boolean

Returns:

  • (Boolean)


20
# File 'lib/graph_weaver/codegen/nodes.rb', line 20

def coerce? = false

#hash_coerce_identity?Boolean

Returns:

  • (Boolean)


21
# File 'lib/graph_weaver/codegen/nodes.rb', line 21

def hash_coerce_identity? = false

#identity?Boolean

Returns:

  • (Boolean)


18
# File 'lib/graph_weaver/codegen/nodes.rb', line 18

def identity? = false

#nestedObject



23
# File 'lib/graph_weaver/codegen/nodes.rb', line 23

def nested = nil

#non_null?Boolean

Returns:

  • (Boolean)


22
# File 'lib/graph_weaver/codegen/nodes.rb', line 22

def non_null? = false

#prop_typeObject



17
# File 'lib/graph_weaver/codegen/nodes.rb', line 17

def prop_type = "T.nilable(#{bare_type})"

#serialize_identity?Boolean

Returns:

  • (Boolean)


19
# File 'lib/graph_weaver/codegen/nodes.rb', line 19

def serialize_identity? = false