msdos50 / Rubyish

Abusing .net to make it more ruby and rails like....I APOLOGIZE FOR NOTHING!
MIT License
1 stars 0 forks source link

convert method casing to snakecase #2

Open tkling opened 4 years ago

tkling commented 4 years ago

To make things even more rubyish :P

Example:


public static bool ToBoolean(this String str) { /.../ }
// becomes
public static bool to_b(this String str) { /.../ }
ghost commented 4 years ago

I was torn on snake casing because I couldn’t get .net to let me omit the parens so it ends up being like “True”.to_b(). The more I think about it the more I like just fully embracing the snake case tho...

tkling commented 4 years ago

Ahh man, yeah. Parens being a necessary evil sounds alright; for me personally, the thing I love about writing ruby is not having to hit shift every couple keystrokes to MakeMyMethodsLookAppropriatelyAssertiveAndPowerful. otoh, I do have to hit shift for _ so it's like... same same but different, ya know?

ghost commented 4 years ago

It would be pretty easy to alias this to to to_b and go ahead and add to_a to enumerable and alias ToTring to to_s. I like it!