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

Use a configuration class, rather than a map #9

Closed
kishorenc opened this issue Feb 16, 2018 · 4 comments
Closed

Use a configuration class, rather than a map #9

kishorenc opened this issue Feb 16, 2018 · 4 comments
Assignees

Comments

@kishorenc
Copy link
Member

kishorenc commented Feb 16, 2018

See this line:

https://github.com/wreally/typesense-python/blob/master/examples/collection_operations.py#L3

It would be good to have a proper configuration class for the Ruby client too, rather than using a dictionary/hashmap.

@jasonbosco
Copy link
Member

@kishorenc We actually do have a Configuration class in the Ruby Client: link.

It's just that the configuration for the nodes themselves (a property inside the config class) uses a hash, rather than another class. I've rarely seen Ruby gems use another class inside the configuration class...

@kishorenc
Copy link
Member Author

@jasonbosco I think this issue is no longer relevant with the class-based approach, where I presume we will have a constructor that will take the server address, port etc.?

@jasonbosco
Copy link
Member

@kishorenc I just replicated the same hash structure when doing Typesense::Client.new. Internally, the hash is converted to a Config class to make it easy to do validations.

Using a configuration class when doing .new seems non-idiomatic to me. So I prefer the hash structure.

@kishorenc
Copy link
Member Author

👍 Closing.

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

2 participants