Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created March 23, 2019 14:08
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 jasongorman/89901a8ae6973bc9cc9b394cc2398cc3 to your computer and use it in GitHub Desktop.
Save jasongorman/89901a8ae6973bc9cc9b394cc2398cc3 to your computer and use it in GitHub Desktop.
customer = Customer.new("Mr", "Jason", "Gorman")
writer = ResponseWriter.new
writer.write(customer, method(:to_html), method(:write_console))
write_logfile = lambda {|o| write_logfile(o, "C:\test\testlog.txt")}
writer.write(customer, method(:to_xml), write_logfile)
write_nosql = lambda {|o| write_nosql(
o,
"mongodb",
"localhost",
"admin",
"password123")}
writer.write(customer, method(:to_string), write_nosql)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment