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

Allow pre-BUILD mixins #37

Merged
merged 3 commits into from
Jun 3, 2022

Conversation

rabbiveesh
Copy link
Contributor

This is an implementation of what I meant for #35. Again, the issue I was having is that I
wanted to mix in a role which had defaults for attributes and other things that would
normally happen at BUILD time. Since I could only mix the behavior in after instantiation,
I had to manually pass through some of the behavior that I wanted to.

This PR simply replaces the fixed $BASE that OpenAPI::Client uses to be the parent for
generated class to instead be the dynamic one that's called.

t/client.t Outdated Show resolved Hide resolved
lib/OpenAPI/Client.pm Outdated Show resolved Hide resolved
@@ -11,8 +11,6 @@ use constant DEBUG => $ENV{OPENAPI_CLIENT_DEBUG} || 0;

our $VERSION = '1.03';

my $BASE = __PACKAGE__;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't remember why I used $BASE and not $class (or $parent). I have to look at the git log too see if I added a comment about it...

@jhthorsen
Copy link
Owner

jhthorsen commented Jun 1, 2022

Can you rebase in main so we get automatic testing?

@rabbiveesh
Copy link
Contributor Author

rabbiveesh commented Jun 1, 2022 via email

Copy link
Owner

@jhthorsen jhthorsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge it since I can't remember why I used $BASE. Guess I have to fix that later on if someone reports a bug 👍

@jhthorsen jhthorsen merged commit 810f532 into jhthorsen:main Jun 3, 2022
jhthorsen added a commit that referenced this pull request Jun 3, 2022
 - Allow inheritance and roles to be applied before new() #35 #37
   Contributor: Veesh Goldman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants