Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def smiley(input)
- if input[:mood] == "happy" #mood is the key, it also has to be a string
- return ":)"
- elsif input[:mood] == "sad"
- return ":("
- else
- return ":|"
- end
- end
- h1 = {:mood => "happy"}
- h2 = {:mood => "sad"}
- h3 = {:mood => "sentimental"}
- puts smiley(h2)
Add Comment
Please, Sign In to add comment