Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # sobre duck typing
- def say(talker)
- puts talker.say
- end
- class Person
- def say
- "I'm a person"
- end
- end
- class Radio
- def say
- "It's a radio"
- end
- end
- say(Person.new) # => "I'm a person"
- say(Radio.new) # => "It's a radio"
Add Comment
Please, Sign In to add comment