Module: Digdag::Configuration

Included in:
Digdag
Defined in:
lib/digdag_client/configuration.rb

Constant Summary collapse

VALID_OPTIONS_KEYS =
[
  :endpoint,
  :use_logger,
  :debug_net_http
].freeze
DEFAULT_ENDPOINT =
'http://localhost:65432/'
DEFAULT_USE_LOGGER =
false
DEFAULT_DEBUG_NET_HTTP =
false

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



18
19
20
# File 'lib/digdag_client/configuration.rb', line 18

def self.extended(base)
  base.reset
end

Instance Method Details

#optionsObject



22
23
24
25
26
# File 'lib/digdag_client/configuration.rb', line 22

def options
  VALID_OPTIONS_KEYS.inject({}) do |option, key|
    option.merge!(key => send(key))
  end
end

#resetObject



28
29
30
31
32
# File 'lib/digdag_client/configuration.rb', line 28

def reset
  self.endpoint = DEFAULT_ENDPOINT
  self.use_logger = DEFAULT_USE_LOGGER
  self.debug_net_http = DEFAULT_DEBUG_NET_HTTP
end