Class: Doorkeeper::Config::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/doorkeeper/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Builder

Returns a new instance of Builder.


59
60
61
62
# File 'lib/doorkeeper/config.rb', line 59

def initialize(&block)
  @config = Config.new
  instance_eval(&block)
end

Instance Method Details

#access_token_methods(*methods) ⇒ Object


89
90
91
# File 'lib/doorkeeper/config.rb', line 89

def access_token_methods(*methods)
  @config.instance_variable_set('@access_token_methods', methods)
end

#buildObject


64
65
66
# File 'lib/doorkeeper/config.rb', line 64

def build
  @config
end

#client_credentials(*methods) ⇒ Object


85
86
87
# File 'lib/doorkeeper/config.rb', line 85

def client_credentials(*methods)
  @config.instance_variable_set('@client_credentials', methods)
end

#confirm_application_ownerObject


73
74
75
# File 'lib/doorkeeper/config.rb', line 73

def confirm_application_owner
  @config.instance_variable_set('@confirm_application_owner', true)
end

#default_scopes(*scopes) ⇒ Object


77
78
79
# File 'lib/doorkeeper/config.rb', line 77

def default_scopes(*scopes)
  @config.instance_variable_set('@default_scopes', OAuth::Scopes.from_array(scopes))
end

#enable_application_owner(opts = {}) ⇒ Object


68
69
70
71
# File 'lib/doorkeeper/config.rb', line 68

def enable_application_owner(opts = {})
  @config.instance_variable_set('@enable_application_owner', true)
  confirm_application_owner if opts[:confirmation].present? && opts[:confirmation]
end

#force_ssl_in_redirect_uri(boolean) ⇒ Object


105
106
107
# File 'lib/doorkeeper/config.rb', line 105

def force_ssl_in_redirect_uri(boolean)
  @config.instance_variable_set("@force_ssl_in_redirect_uri", boolean)
end

#optional_scopes(*scopes) ⇒ Object


81
82
83
# File 'lib/doorkeeper/config.rb', line 81

def optional_scopes(*scopes)
  @config.instance_variable_set('@optional_scopes', OAuth::Scopes.from_array(scopes))
end

#realm(realm) ⇒ Object


97
98
99
# File 'lib/doorkeeper/config.rb', line 97

def realm(realm)
  @config.instance_variable_set('@realm', realm)
end

#reuse_access_tokenObject


101
102
103
# File 'lib/doorkeeper/config.rb', line 101

def reuse_access_token
  @config.instance_variable_set("@reuse_access_token", true)
end

#use_refresh_tokenObject


93
94
95
# File 'lib/doorkeeper/config.rb', line 93

def use_refresh_token
  @config.instance_variable_set('@refresh_token_enabled', true)
end