Skip to content

Instantly share code, notes, and snippets.

@joemsak
Last active August 29, 2015 14:07
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 joemsak/658219487419259ddb32 to your computer and use it in GitHub Desktop.
Save joemsak/658219487419259ddb32 to your computer and use it in GitHub Desktop.
module BaseballStats
module UI
class PlainTextMenu
attr_reader :reporters, :printer, :input_device
# dependency injection
def initialize(reporters, printer, input_device)
@reporters = reporters
@printer = printer
@input_device = input_device
output_header
end
#...
# a little bit of fun
def header
<<-EOD
* * * * * * * * * * * * * * * * * * * *
* Welcome! To the *
* Baseball Stats Reporter *
* Play ball! *
* (well, read about ppl who do) *
* * * * * * * * * * * * * * * * * * * *
EOD
end
#...
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment