Skip to content

Instantly share code, notes, and snippets.

@rachidcalazans
Created September 29, 2018 03:42
Show Gist options
  • Save rachidcalazans/215a6d3d405334804de7c744019b4f5c to your computer and use it in GitHub Desktop.
Save rachidcalazans/215a6d3d405334804de7c744019b4f5c to your computer and use it in GitHub Desktop.
Design Patterns in Ruby - Template Method
class Cappuccino < CaffeineBeverage
def brew_condiments
puts 'brew cappuccino grinds'
end
def add_aditional_condiments
puts 'add sugar'
end
end
class Tea < CaffeineBeverage
def brew_condiments
puts 'steep the bag'
end
def add_aditional_condiments
puts 'add lemon'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment