Sha256: 473179495de5601c576772ed07742918132338dc0481572890572b19d24d900f

Contents?: true

Size: 588 Bytes

Versions: 6

Compression:

Stored size: 588 Bytes

Contents

# frozen_string_literal: true
require_relative "./base"

module Bitly
  module API
    class OAuthApp
      include Base

      def self.attributes
        [:name, :description, :link, :client_id]
      end
      attr_reader(*attributes)

      def self.fetch(client:, client_id:)
        response = client.request(path: "/apps/#{client_id}")
        new(data: response.body, client: client, response: response)
      end

      def initialize(data:, client:, response: nil)
        assign_attributes(data)
        @client = client
        @response = response
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bitly-2.1.0 lib/bitly/api/oauth_app.rb
bitly-2.0.2 lib/bitly/api/oauth_app.rb
bitly-2.0.1 lib/bitly/api/oauth_app.rb
bitly-2.0.0 lib/bitly/api/oauth_app.rb
bitly-2.0.0.beta.2 lib/bitly/api/oauth_app.rb
bitly-2.0.0.beta.1 lib/bitly/api/oauth_app.rb