Sha256: a058a6dc05810e10fa701a5b63a70277bcb9d85de0f16a773ddb4f81b1fe13b3

Contents?: true

Size: 809 Bytes

Versions: 4

Compression:

Stored size: 809 Bytes

Contents

# Copyright 2022 Daniel Herzog
# Use of this source code is governed by an MIT
# license that can be found in the LICENSE.md file.
# frozen_string_literal: true

module DeepL
  module Requests
    module Glossary
      class Find < Base
        attr_reader :id

        def initialize(api, id, options = {})
          super(api, options)
          @id = id
        end

        def request
          build_glossary(*execute_request_with_retries(get_request))
        end

        def to_s
          "GET #{uri.request_uri}"
        end

        private

        def build_glossary(request, response)
          glossary = JSON.parse(response.body)
          Resources::Glossary.new(glossary, request, response)
        end

        def path
          "glossaries/#{id}"
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
deepl-rb-3.1.0 lib/deepl/requests/glossary/find.rb
deepl-rb-3.0.2 lib/deepl/requests/glossary/find.rb
deepl-rb-3.0.1 lib/deepl/requests/glossary/find.rb
deepl-rb-3.0.0 lib/deepl/requests/glossary/find.rb