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
# From top comment on http://www.reddit.com/r/ruby/comments/29hr4x/whats_youre_favorite_ruby_trick_or_quirk_that/?utm_source=rubyweekly&utm_medium=email | |
class FakeRedditApi | |
def initialize | |
@count = 0 | |
end | |
def has_next_post? |
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
class Chicken | |
end | |
class Beef | |
end | |
class Restaurant |
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
module Cookable | |
def make_into dish | |
dish.make_into self | |
end | |
def to_s | |
self.class.to_s | |
end | |
end |