sudoblockio / tackle

Tackle is a programmable configuration language for building modular utilities, code generators, and CLIs with schema validation baked in.
Apache License 2.0
51 stars 2 forks source link

Method Properties #242

Open robcxyz opened 8 months ago

robcxyz commented 8 months ago

Method Properties

Methods could have properties which inform their behaviour

Overview

It would be helpful if we could expose the control of how methods operated with parameters such as:

Example - merge:


MyHook<-:

  foo: bar

  my_method:

    <-:

      bar: baz

    merge: False

expected_output:

  foo: bar

  my_method:

    bar: baz

assert->: |

  {{MyHook.my_method()}} {{expected_output}}

This should not be super hard to implement as methods are just hooks which can have hook_call parameters which can be injected in. Only issue is the merge functionality needs to be modified or rethought since right now it is the default. So in the future that will need to be parameterized.