-
Notifications
You must be signed in to change notification settings - Fork 28
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
Autogenerate *?
methods for outputs.
#59
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 😍
Can you also add a line in the README, under the unreleased
section? 🙏🏻
Co-authored-by: Sunny Ripert <sunny@sunfox.org>
Co-authored-by: Sunny Ripert <sunny@sunfox.org>
Co-authored-by: Sunny Ripert <sunny@sunfox.org>
I'm sorry. do you mean the CHANGELOG.md file? |
Woops, my bad. Yes, the CHANGELOG 😅 |
Co-authored-by: Sunny Ripert <sunny@sunfox.org>
@sunny. I've updated the codebase. Let me know if there are any other issues!. |
spec/result_spec.rb
Outdated
expect(result.respond_to?(:name?)).to eq true | ||
end | ||
|
||
context "String" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To follow the RSpec/ContextWording
RuboCop convention, contexts should start with when
, with
or without
.
context "String" do | |
context "when input is a String" do |
There are a few code-style suggestions that deserved to change so I changed the RuboCop configuration a bit to prefer double-quoted strings for example. Can you fetch the latest version:
Make sure RuboCop & RSpec run smoothly:
🙏🏻 |
Co-authored-by: Sunny Ripert <sunny@sunfox.org>
Co-authored-by: Sunny Ripert <sunny@sunfox.org>
Yes, let’s turn this one off. Can you add the following to the Style/DoubleNegation:
Enabled: false Also tests seem to fail on Ruby lower than 3. I think that’s because |
Hopefully. It won't give any more errors 💀 |
@sunny any updates on this PR?. |
Looks good! That's a great addition to Actor, thank you \o/ 🎉 |
This is a continuation of #58. Closes #58
Since these methods are not often used and there is no guarantee the developer would want one. They are only generated when a call is made for an
output
value that has been defined.This way, these methods(ending with
?
) will never be generated if not called.This uses the standard way
OpenStruct
defines methods, in listening tomethod_missing
and checking if there is an attribute defined on the object.Then, we define the method on the fly and call it immediatly to return the result to the caller.