lib/deepl/configuration.rb in deepl-rb-2.1.0 vs lib/deepl/configuration.rb in deepl-rb-2.2.0
- old
+ new
@@ -1,14 +1,15 @@
module DeepL
class Configuration
- ATTRIBUTES = %i[auth_key host].freeze
+ ATTRIBUTES = %i[auth_key host version].freeze
attr_accessor(*ATTRIBUTES)
def initialize(data = {})
data.each { |key, value| send("#{key}=", value) }
@auth_key ||= ENV['DEEPL_AUTH_KEY']
@host ||= 'https://api.deepl.com'
+ @version ||= 'v2'
end
def validate!
raise Exceptions::Error, 'auth_key not provided' if auth_key.nil? || auth_key.empty?
end