G
Gavin Sinclair
Hi all,
I'm preparing some methods for 'extensions' [1] and would like some
people's opinions on method names.
Array#only
[5].only -> 5
[1,2,3].only -> exception
Class.get_class
Class.get_class("Test::Unit") -> Test::Unit
Class.get_class("not-a-class") -> exception
# Should 'get_class' be in Class or in Kernel?
Class#bare_name
Test::Unit.bare_name -> "Unit"
String#line_wrap
"the quick brown fox jumps ...".line_wrap(10)
-> "the quick
brown fox
jumps ..."
Thanks,
Gavin
[1] http://extensions.rubyforge.org
I'm preparing some methods for 'extensions' [1] and would like some
people's opinions on method names.
Array#only
[5].only -> 5
[1,2,3].only -> exception
Class.get_class
Class.get_class("Test::Unit") -> Test::Unit
Class.get_class("not-a-class") -> exception
# Should 'get_class' be in Class or in Kernel?
Class#bare_name
Test::Unit.bare_name -> "Unit"
String#line_wrap
"the quick brown fox jumps ...".line_wrap(10)
-> "the quick
brown fox
jumps ..."
Thanks,
Gavin
[1] http://extensions.rubyforge.org