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
Make all Sequel::Inflections' methods public #1070
Conversation
As a general principle of API design, methods should be private unless there is a need to call them by external objects. The problem with this change is that would automatically add these methods to the public API of One option would be to change The It's easy to increase the scope of the public API, it's much more difficult to decrease the scope. For that reason public API additions should be heavily scrutinized. Can you open up a thread on the sequel-talk Google Group and see what the community thinks about this? I'm not against the |
@jeremyevans, thanks for reply! I just don't understand why "The inflection methods are an implementation detail to the working of |
|
Ok, in other words: methods of |
The purpose of Sequel is to offer database access and an ORM ( |
Thanks! P.S.: The code when they use this API - here. |
The last question (I'm sorry very much for discussion here). Why do we class Post < Sequel::Model
constantize('Post') # ok
def meth
constantize('Post') # undefined method error (on meth call)
end
end What's the sense here? Thanks. |
In general the inflection stuff is not needed at the instance level, only at the class level (automatic table naming, association method creation). This is ruby, you are free to include Inflections in Model if it makes sense in your application. :) |
Make all Sequel::Inflections' methods public.
I.e. we can use
Sequel.inflections.pluralize
in plugins, code, etc.Why are they
private
?