Class: Podio::OAuth

Inherits:
ActivePodio::Base show all
Defined in:
lib/podio/models/o_auth.rb

Overview

Instance Attribute Summary

Attributes inherited from ActivePodio::Base

#attributes

Class Method Summary collapse

Methods inherited from ActivePodio::Base

#==, #[], #[]=, #api_friendly_ref_type, #as_json, collection, delegate_to_hash, has_many, has_one, #hash, #initialize, #initialize_attributes, klass_from_string, list, member, #new_record?, output_attribute_as_json, #parent_model, #persisted?, property, #to_param

Constructor Details

This class inherits a constructor from ActivePodio::Base

Class Method Details

.authorize(attributes) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/podio/models/o_auth.rb', line 4

def authorize(attributes)
  response = Podio.connection.post do |req|
    req.url "/oauth/authorize"
    req.body = attributes
  end

  response.body
end

.get_access_token(attributes) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/podio/models/o_auth.rb', line 23

def get_access_token(attributes)
  response = Podio.connection.post do |req|
    req.url "/oauth/token"
    req.body = attributes
  end

  response.body
end

.get_info(attributes) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/podio/models/o_auth.rb', line 13

def get_info(attributes)
  response = Podio.connection.post do |req|
    req.url "/oauth/info"
    req.body = attributes
  end

  response.body
end

.invalidate_grantObject



33
34
35
36
37
38
39
# File 'lib/podio/models/o_auth.rb', line 33

def invalidate_grant
  response = Podio.connection.post do |req|
    req.url '/oauth/grant/invalidate'
  end

  response.status
end