Pass builder instead of individual arguments

Config members will get large.
Preventing a large amount of arguments in advance.
This commit is contained in:
Michael Miller 2019-03-21 23:03:13 -06:00
parent 42e8064e5c
commit fe81586527
2 changed files with 4 additions and 3 deletions

View file

@ -5,7 +5,8 @@ module Spectator
getter formatter : Formatting::Formatter
# Creates a new configuration.
def initialize(@formatter)
def initialize(builder)
@formatter = builder.formatter
end
end
end

View file

@ -18,7 +18,7 @@ module Spectator
# Retrieves the formatter to use.
# If one wasn't specified by the user,
# then `#default_formatter` is returned.
private def formatter
def formatter
@formatter || default_formatter
end
@ -30,7 +30,7 @@ module Spectator
# Creates a configuration.
def build : Config
Config.new(formatter)
Config.new(self)
end
end
end