Class: AuthProvider::Config::Builder
- Inherits:
-
Object
- Object
- AuthProvider::Config::Builder
- Defined in:
- lib/auth_provider/config.rb
Instance Method Summary collapse
- #access_token_expires_in(time) ⇒ Object
- #build ⇒ Object
-
#default_resource_owner_type(type) ⇒ Object
Configuration methods.
-
#initialize(&block) ⇒ Builder
constructor
A new instance of Builder.
- #resource_owner_from_credentials(&block) ⇒ Object
Constructor Details
#initialize(&block) ⇒ Builder
Returns a new instance of Builder.
27 28 29 30 31 32 33 34 35 |
# File 'lib/auth_provider/config.rb', line 27 def initialize(&block) @config = Config.new instance_eval(&block) # Define default @config.default_resource_owner_type ||= 'User' @config.access_token_expiration_time ||= 2.hours end |
Instance Method Details
#access_token_expires_in(time) ⇒ Object
51 52 53 |
# File 'lib/auth_provider/config.rb', line 51 def access_token_expires_in(time) @config.access_token_expiration_time = time end |
#build ⇒ Object
37 38 39 |
# File 'lib/auth_provider/config.rb', line 37 def build @config end |
#default_resource_owner_type(type) ⇒ Object
Configuration methods
43 44 45 |
# File 'lib/auth_provider/config.rb', line 43 def default_resource_owner_type(type) @config.default_resource_owner_type = type.to_s end |
#resource_owner_from_credentials(&block) ⇒ Object
47 48 49 |
# File 'lib/auth_provider/config.rb', line 47 def resource_owner_from_credentials(&block) @config.resource_owner_from_credentials = block end |