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

- old
+ new

@@ -8,31 +8,35 @@ # token: used to authenticate the requests # host: defaults to https://api.monday.com/v2 class Configuration DEFAULT_HOST = "https://api.monday.com/v2" DEFAULT_TOKEN = nil + DEFAULT_VERSION = "2023-07" CONFIGURATION_FIELDS = %i[ token host + version ].freeze attr_accessor(*CONFIGURATION_FIELDS) 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 + @version = DEFAULT_VERSION config_args.each do |key, value| public_send("#{key}=", value) end end def reset @token = DEFAULT_TOKEN @host = DEFAULT_HOST + @version = DEFAULT_VERSION end end end