We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a68be4 commit a25cb43Copy full SHA for a25cb43
lib/async/service/loader.rb
@@ -47,11 +47,14 @@ def environment(**initial, &block)
47
Environment.build(**initial, &block)
48
end
49
50
- # Define a host with the specified name.
51
- # Adds `root` and `authority` keys.
+ # Define a service with the specified name.
+ # Adds `root` and `name` keys.
52
# @parameter name [String] The name of the environment, usually a hostname.
53
- def service(name, &block)
54
- @configuration.add(self.environment(name: name, root: @root, &block))
+ def service(name = nil, **options, &block)
+ options[:name] = name
55
+ options[:root] ||= @root
56
+
57
+ @configuration.add(self.environment(**options, &block))
58
59
60
0 commit comments