Last active
August 29, 2015 13:56
-
-
Save fourseven/9259219 to your computer and use it in GitHub Desktop.
Ruby vs ObjC named params
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have: | |
def self.find_bot_for_user_from_token(current_user, oauth_token) | |
end | |
Using named params it would be (requires 2.1 to not have defaults): | |
def self.find_bot(for_user:, from_token:) | |
puts for_user | |
end | |
vs | |
+ (Bot *)findBotForUser:(User *)user fromToken:(Oauth *)token | |
{ | |
NSLog(@"$@", user); | |
} | |
I like ObjC much more here. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should be able to do:
def self.find_bot_for_user(user, from_token:)
end
called as
Bot.find_bot_for_user user, from_token:'wat' #So just a comma different?