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

Consider making ledger and entries custom objects #11

Open
acook opened this issue Apr 14, 2022 · 0 comments
Open

Consider making ledger and entries custom objects #11

acook opened this issue Apr 14, 2022 · 0 comments

Comments

@acook
Copy link
Owner

acook commented Apr 14, 2022

The ledger itself is an array which returns structured arrays of each method call it received:

[[method_name, arguments_sent_to_method, block_passed_to_method], ...]

But you have to know the structure or look it up every time to make sure you know what is what. If instead the ledger returned objects (even just OpenStruct) which provided those values directly or optionally converted to an array, it might require less time consulting the documentation.

We could also add interesting methods to the ledger which could extract different dimensions of that data directly (like the list of methods only as demonstrated below).

imp.impasta.ledger.first.caller #=> caller stacktrace
imp.impasta.ledger.messages #=> [:foo, :bar, :baz] 
@acook acook changed the title Consider ledger and entries being objects to make interaction more intuitive Consider making ledger and entries custom objects Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant