Skip to content

Instantly share code, notes, and snippets.

@fourseven
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fourseven/9259219 to your computer and use it in GitHub Desktop.
Save fourseven/9259219 to your computer and use it in GitHub Desktop.
Ruby vs ObjC named params
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.
@toxaq
Copy link

toxaq commented Feb 27, 2014

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment