Class: Access::OauthApplication

Inherits:
Object
  • Object
show all
Includes:
MuchMeta
Defined in:
lib/access/oauth_application.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from MuchMeta

#set_up_methods, #set_values

Constructor Details

#initialize(values) ⇒ OauthApplication

Returns a new instance of OauthApplication.



51
52
53
54
55
56
57
# File 'lib/access/oauth_application.rb', line 51

def initialize(values)
  @used_fields = []
  set_up_methods(values)
  set_values(values)
  @links = Access::Link.new(@links) if @links
  @filter = Access::Filter.new(@filter) if @filter
end

Class Method Details

.create(options = {}) ⇒ Object



32
33
34
35
# File 'lib/access/oauth_application.rb', line 32

def self.create(options = {})
  # Internal Admin only Call
  Access::Api.new.create_oauth_application options
end

.create_token(application_id, options = {}) ⇒ Object



27
28
29
30
# File 'lib/access/oauth_application.rb', line 27

def self.create_token(application_id, options = {})
  # Internal Admin only Call
  Access::Api.new.create_oauth_application_token application_id, options
end

.delete(application_id, options = {}) ⇒ Object



42
43
44
45
# File 'lib/access/oauth_application.rb', line 42

def self.delete(application_id, options = {})
  # Internal Admin only Call
  Access::Api.new.delete_oauth_application application_id, options
end

.find(application_id, options = {}) ⇒ Object



10
11
12
13
# File 'lib/access/oauth_application.rb', line 10

def self.find(application_id, options = {})
  # Internal Admin only Call
  Access::Api.new.find_oauth_application application_id, options
end

.find_token(application_id, token_id, options = {}) ⇒ Object



21
22
23
24
25
# File 'lib/access/oauth_application.rb', line 21

def self.find_token(application_id, token_id, options = {})
  # Internal Admin only Call
  # Returns Token Response
  Access::Api.new.find_oauth_application_token application_id, token_id, options
end

.process_batch(chunk) ⇒ Object



47
48
49
# File 'lib/access/oauth_application.rb', line 47

def self.process_batch(chunk)
  chunk.map { |application| new(application) }
end

.search(options = {}) ⇒ Object



5
6
7
8
# File 'lib/access/oauth_application.rb', line 5

def self.search(options = {})
  # Internal Admin only Call
  Access::Api.new.search_oauth_applications options
end

.search_tokens(application_id, options = {}) ⇒ Object



15
16
17
18
19
# File 'lib/access/oauth_application.rb', line 15

def self.search_tokens(application_id, options = {})
  # Internal Admin only Call
  # Returns Token Response
  Access::Api.new.search_oauth_application_tokens application_id, options
end

.update(application_id, options = {}) ⇒ Object



37
38
39
40
# File 'lib/access/oauth_application.rb', line 37

def self.update(application_id, options = {})
  # Internal Admin only Call
  Access::Api.new.update_oauth_application application_id, options
end

Instance Method Details

#has_scope?(scope) ⇒ Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/access/oauth_application.rb', line 59

def has_scope?(scope)

end

#oauth_application_keyObject



63
64
65
# File 'lib/access/oauth_application.rb', line 63

def oauth_application_key
  @id
end