lib/deepl.rb in deepl-rb-1.0.1 vs lib/deepl.rb in deepl-rb-2.0.0

- old
+ new

@@ -9,15 +9,17 @@ require 'deepl/exceptions/bad_request' require 'deepl/exceptions/limit_exceeded' # -- Requests require 'deepl/requests/base' -require 'deepl/requests/translate_text' +require 'deepl/requests/translate' +require 'deepl/requests/usage' # -- Responses and resources require 'deepl/resources/base' require 'deepl/resources/text' +require 'deepl/resources/usage' # -- Other wrappers require 'deepl/api' require 'deepl/configuration' @@ -31,10 +33,15 @@ @api ||= API.new(configuration) end def translate(text, source_lang, target_lang, options = {}) configure if @configuration.nil? - Requests::TranslateText.new(api, text, source_lang, target_lang, options).request + Requests::Translate.new(api, text, source_lang, target_lang, options).request + end + + def usage(options = {}) + configure if @configuration.nil? + Requests::Usage.new(api, options).request end # -- Configuration def configuration