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

Improved and enforced consistency between Namespace#create_x and X#initialize #87

Open
AaronC81 opened this issue May 14, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@AaronC81
Copy link
Owner

AaronC81 commented May 14, 2020

It would be good to ensure that the signatures for Namespace#create_x methods are the same as the signatures for the corresponding X#initialize methods (besides the generator parameter), improving the internal consistency of Parlour.

For example, the signature for Namespace#create_method is:

def create_method(name, parameters: nil, return_type: nil, returns: nil, abstract: false, ...)

But the signature for Method#initialize uses some positional arguments as keyword arguments instead:

def initialize(generator, name, parameters, return_type = nil, abstract: false, ...)

(This would have to be considered a breaking change.)

This consistency could also to enforced in tests by having a test which grabs method parameters and compares for each, adding a layer of protection against adding a parameter to one but not the other by accident.

@AaronC81 AaronC81 added the enhancement New feature or request label May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant