Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method Properties #242

Open
robcxyz opened this issue Jan 1, 2024 · 0 comments
Open

Method Properties #242

robcxyz opened this issue Jan 1, 2024 · 0 comments
Labels
proposal Proposal for changes in syntax / behaviour wip A work in progress proposal

Comments

@robcxyz
Copy link
Collaborator

robcxyz commented Jan 1, 2024

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:

  • merge - Informs if the method's output is merged into the top level keys - the default behaviour. False would keep the data under the method name (see below).

  • try / except - Wrap method with try accept

  • for - Run the method on some loop

  • ?

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.

@robcxyz robcxyz changed the title tmp Method Properties Jan 1, 2024
@robcxyz robcxyz added proposal Proposal for changes in syntax / behaviour wip A work in progress proposal labels Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Proposal for changes in syntax / behaviour wip A work in progress proposal
Projects
None yet
Development

No branches or pull requests

1 participant