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

Coercers with remote version fetch #606

Closed
wants to merge 8 commits into from

Conversation

jtgrenz
Copy link
Contributor

@jtgrenz jtgrenz commented Aug 15, 2019

Just to make this a little easier to reason about. I branched off #600 and incorporated #603 to get a better sense of how they would look together. This PR isn't ready to go and I didn't port over any tests yet. I think I'm still leaning on the side of this might be a little over kill, but I wanted to see it all together anyway.

@alexaitken thoughts?


def self.define_version(version)
@versions ||= {}
def coercion_mode=(mode)
Copy link
Contributor

Choose a reason for hiding this comment

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

assignment of the coercer replaced the symbols it also allows for extension by implementing any coercer you want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah yes, sorry. That got lost in translation last night. I'm not sure what else someone would want to do though beyond always creating a new version and raising an error if a version is not in the known set. If we had another use case I think I'd be more open to using a coercer class like this.

Do you have an idea of any future needs that would require this extra flexibility and abstraction from the ApiVersion class?

@jtgrenz jtgrenz closed this Nov 15, 2019
@jtgrenz jtgrenz deleted the coercers_with_remote_version_fetch branch November 15, 2019 16:14
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

Successfully merging this pull request may close these issues.

None yet

2 participants