Created
July 16, 2012 13:20
-
-
Save notyy/3122675 to your computer and use it in GitHub Desktop.
scala_lecture,ruby comparation5
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
def match_type param | |
if param.kind_of? Integer | |
puts "it's a Integer" | |
end | |
if param.kind_of? String | |
puts "its a String" | |
end | |
if param.kind_of? Array | |
puts "its an Array" | |
end | |
end | |
match_type("abc") | |
match_type(1) | |
match_type([1,2,3]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment