mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Pass builder instead of individual arguments
Config members will get large. Preventing a large amount of arguments in advance.
This commit is contained in:
parent
42e8064e5c
commit
fe81586527
2 changed files with 4 additions and 3 deletions
|
@ -5,7 +5,8 @@ module Spectator
|
||||||
getter formatter : Formatting::Formatter
|
getter formatter : Formatting::Formatter
|
||||||
|
|
||||||
# Creates a new configuration.
|
# Creates a new configuration.
|
||||||
def initialize(@formatter)
|
def initialize(builder)
|
||||||
|
@formatter = builder.formatter
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,7 +18,7 @@ module Spectator
|
||||||
# Retrieves the formatter to use.
|
# Retrieves the formatter to use.
|
||||||
# If one wasn't specified by the user,
|
# If one wasn't specified by the user,
|
||||||
# then `#default_formatter` is returned.
|
# then `#default_formatter` is returned.
|
||||||
private def formatter
|
def formatter
|
||||||
@formatter || default_formatter
|
@formatter || default_formatter
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ module Spectator
|
||||||
|
|
||||||
# Creates a configuration.
|
# Creates a configuration.
|
||||||
def build : Config
|
def build : Config
|
||||||
Config.new(formatter)
|
Config.new(self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue