Skip to content

Instantly share code, notes, and snippets.

@mleszcz
Last active May 12, 2018 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mleszcz/8448f3e641e94b888fac86e6661228a6 to your computer and use it in GitHub Desktop.
Save mleszcz/8448f3e641e94b888fac86e6661228a6 to your computer and use it in GitHub Desktop.
class Invoice
attr_accessor :product_name
# default name
def name
"Invoice for #{@product_name}"
end
end
class InvoiceEmail < Invoice
def send
puts "Emailing an invoice..."
puts name
end
def name
"Any other, specific formatting of a name #{@product_name}"
end
end
class InvoicePresenter < Invoice
def short_name
puts name
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment