Sha256: 1a26e65e4ee3a49d625bc0492696742b3c5bc44e7514945b4567e4675dd98009

Contents?: true

Size: 792 Bytes

Versions: 6

Compression:

Stored size: 792 Bytes

Contents

module Blurb
  class Token

    def self.code(auth_code)
      response = Blurb::client.request(:post, "/auth/o2/token",
        {
          body: {
            grant_type: "authorization_code",
            client_id: Blurb.client_id,
            code: auth_code,
            client_secret: Blurb.client_secret
          }
        }
      )

      return JSON.parse(response.body)
    end

    def self.retrieve(params = {}, opts = {})
      response = Blurb::client.request(:post, "/auth/o2/token",
        {
          body: {
            grant_type: "refresh_token",
            client_id: Blurb.client_id,
            refresh_token: Blurb.refresh_token,
            client_secret: Blurb.client_secret
          }
        }
      )

      return JSON.parse(response.body)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
blurb-0.2.3 lib/blurb/token.rb
blurb-0.2.2 lib/blurb/token.rb
blurb-0.2.1 lib/blurb/token.rb
blurb-0.2.0 lib/blurb/token.rb
blurb-0.1.2 lib/blurb/token.rb
blurb-0.1.1 lib/blurb/token.rb