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
Idiomatic callbacks #91
Conversation
…Resource::Callbacks#authorized?
…source::Callbacks#conflict?
Agree on the idiomacy, but as we're past 1.0, we need to keep the |
I'll add the aliases. What are your feelings regarding renaming generate_etag to etag? I understand the callbacks as attributes of the resource, which makes the calculation prefix inappropriate IMHO. Jamie |
For backwards compatibility
For backwards compatibility
…esource::Callbacks#etag
For backwards compatibility
I've added aliases for |
There are specs for First interesting question about changing the resource API: in the transition phase, do we test the old or new methods? 😈 |
I have changed all the specs to use the new methods. I hope this is acceptable. On 05/01/2013, at 22.00, Lars Gierth notifications@github.com wrote:
|
I guess @seancribbs wanted to keep the callback names close to the ones in basho/webmachine. If that is still a goal, I would oppose to this change to keep the callback API small. |
Let's wait for his reaction. I don't see any additional changes, so I would argue that three aliases is not egregious. |
I agree that aliases are totally fine, even if I don't like all of the proposed changes (i probably prefer 'generate_etag' over just 'etag'), but having that choice is cool. |
This is stale, closing. I still maintain that there is value in keeping the callback names as close to the Erlang version, even if they aren't "idiomatic" to Ruby. |
This is certainly a case of pickiness, but
is_authorized?
andis_conflict?
don't feel very idiomatic. I've renamed them toauthorized?
andconflict?
, so that they more closely resemble, for example,forbidden?
. I was also tempted to renamegenerate_etag
toetag
, but saw that a number of tests currently include:etag
.I realize that there would need to be a deprecation of the existing syntax, but I a) didn't know if you already have a deprecation policy or; b) whether you agreed with the changes to begin with.
Regards,
Jamie