Module: Jade::Codegen::PortCodec

Extended by:
PortCodec
Included in:
PortCodec
Defined in:
lib/jade/codegen/port_codec.rb

Constant Summary collapse

PASS_DECODER =
"Jade::Decode::Decoder[Jade::Decode::Desc::Pass[]]"
PASS_ENCODER =
"->(v) { v }"

Instance Method Summary collapse

Instance Method Details

#task_call(interop_fn, registry, dictionaries = []) ⇒ Object

dictionaries is the call site's constraint-attachment list; only used when an arm or a parameter is a Dict marker.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/jade/codegen/port_codec.rb', line 11

def task_call(interop_fn, registry, dictionaries = [])
  [
    interop_fn.interop_module_name,
    ":#{interop_fn.name}",
    codec(interop_fn.decoders.fetch(:ok), 'decoder', interop_fn, registry, dictionaries),
    codec(interop_fn.decoders.fetch(:err), 'decoder', interop_fn, registry, dictionaries),
    encoders(interop_fn, registry, dictionaries),
  ]
    .join(', ')
    .then { "Jade::Runtime.task_call(#{it})" }
end