lib/monday/configuration.rb in monday_ruby-0.1.0 vs lib/monday/configuration.rb in monday_ruby-0.2.0

- old
+ new

@@ -7,11 +7,11 @@ # # token: used to authenticate the requests # host: defaults to https://api.monday.com/v2 class Configuration DEFAULT_HOST = "https://api.monday.com/v2" - private_constant :DEFAULT_HOST + DEFAULT_TOKEN = nil CONFIGURATION_FIELDS = %i[ token host ].freeze @@ -21,12 +21,18 @@ def initialize(**config_args) invalid_keys = config_args.keys - CONFIGURATION_FIELDS raise ArgumentError, "Unknown arguments: #{invalid_keys}" unless invalid_keys.empty? @host = DEFAULT_HOST + @token = DEFAULT_TOKEN config_args.each do |key, value| public_send("#{key}=", value) end + end + + def reset + @token = DEFAULT_TOKEN + @host = DEFAULT_HOST end end end