Last active
August 17, 2016 22:41
-
-
Save jordanhudgens/1859b1bbde7926af720cc8459e51a07f to your computer and use it in GitHub Desktop.
This file contains 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 OrderReport | |
def initialize(customer:, total:) | |
@customer = customer | |
@total = total | |
end | |
end | |
class Invoice < OrderReport | |
def print_out | |
puts "Invoice" | |
puts @customer | |
puts @total | |
end | |
end | |
class BillOfLading < OrderReport | |
def initialize(address:, **args) | |
super(**args) | |
@address = address | |
end | |
def print_out | |
puts "BOL" | |
puts @customer | |
puts "Shiping Label..." | |
puts @address | |
end | |
end | |
invoice = Invoice.new(customer: "Google", total: 100) | |
bill_of_lading = BillOfLading.new(customer: "Yahoo", total: 200, address: "123 Any Street") | |
invoice.print_out | |
bill_of_lading.print_out | |
# Invoice | |
# 100 | |
# BOL | |
# Yahoo | |
# Shiping Label... | |
# 123 Any Street |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment