Created
February 9, 2012 21:46
-
-
Save metacritical/1783500 to your computer and use it in GitHub Desktop.
Lets judge Which is better...
This file contains hidden or 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 Carpark | |
def initialize(arguments) | |
@program_mode = {true => Interactive,false => Filemode}[arguments].new | |
end | |
end | |
arg_params = ARGV.empty? | |
carpark = Carpark.new(arg_params) | |
V.S (versus) | |
class Carpark | |
def initialize(mode) | |
@mode = mode | |
end | |
end | |
class CommandLineParser | |
def initialize(arguments) | |
@arguments = arguments | |
end | |
def build_input_mode | |
arguments.empty? ? Interactive.new : Filemode.new | |
end | |
end | |
Carpark.new(CommandLineParser.new(ARGV).build_input_mode) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment