Closed pote closed 10 years ago
Woah woah woah, advanced features :-)
Thanks, will check it out!
On Mon, Feb 24, 2014 at 2:57 PM, Pablo Astigarraga <notifications@github.com
wrote:
From Ruby 2.1 onwards the def method returns a symbol created from the method's name, allowing us to avoid a bit of repetition when declaring private methods.
Ruby 2.0 < def foo; endprivate :foo
Ruby 2.1 > private def foo; end
This pull request shouldn't be merged until cuba stops supporting Ruby versions prior to 2.1, so I expect it to never be merged in practice.
I was super bored though.
You can merge this Pull Request by running
git pull https://github.com/pote/cuba briefer_private_defs
Or view, comment on, or merge it at:
https://github.com/soveran/cuba/pull/34 Commit Summary
- Take advantage of ruby 2.1's #def returns
File Changes
- M lib/cuba.rbhttps://github.com/soveran/cuba/pull/34/files#diff-0(6)
- M lib/cuba/render.rbhttps://github.com/soveran/cuba/pull/34/files#diff-1(3)
Patch Links:
Reply to this email directly or view it on GitHubhttps://github.com/soveran/cuba/pull/34 .
Don't merge it or you'll break everything for everyone! :P
private def foo
? What is this? JAVA?
It totally is.
This way of declaring a private method:
def foo; end
private :foo
Is set before Ruby 2.0. In my opinion, I don't think good to apply such a small change, only available in the latest version.
@rogeriozambon totally! this whole PR was mostly a joke :)
I will close this for now, and reopen it in the future if we are still using Ruby.
From Ruby 2.1 onwards the def method returns a symbol created from the method's name, allowing us to avoid a bit of repetition when declaring private methods.
This pull request shouldn't be merged until cuba stops supporting Ruby versions prior to 2.1, so I expect it to never be merged in practice.
I was super bored though.