Class: Admincredible::Configuration
- Inherits:
-
Object
- Object
- Admincredible::Configuration
- Defined in:
- lib/admincredible/configuration.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Mixed
Optional.
-
#authenticator ⇒ Symbol
Optional.
-
#connection_options ⇒ Hash
Optionals.
-
#consumer_key ⇒ String
Optional.
-
#consumer_secret ⇒ String
Optional.
-
#direct_endpoint ⇒ String
Optional.
-
#logger ⇒ Logger
Optional.
-
#main_endpoint ⇒ String
Optional.
-
#oauth_callback ⇒ String
Optional.
-
#step_after_seconds ⇒ Integer
Optional.
-
#token ⇒ String
Optional.
-
#token_secret ⇒ String
Optional.
-
#url ⇒ String
Returns the url with the endpoint.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #oauth? ⇒ Boolean
- #oauth_options ⇒ Object
-
#raw_url ⇒ String
Returns the raw url that was set during configuration of the client.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
75 76 77 78 79 80 |
# File 'lib/admincredible/configuration.rb', line 75 def initialize @connection_options = {} @direct_endpoint = '/components/com_admincredible/direct.php' @main_endpoint = '/index.php?option=com_admincredible&view=authorize' @step_after_seconds = 1 end |
Instance Attribute Details
#adapter ⇒ Mixed
Returns Optional. Faraday adapter.
62 63 64 |
# File 'lib/admincredible/configuration.rb', line 62 def adapter @adapter end |
#authenticator ⇒ Symbol
Returns Optional. The authenticator type to use. Not used right now but here for future flexibility When using gem you should set it just be safe. Defaults to :debug.
25 26 27 |
# File 'lib/admincredible/configuration.rb', line 25 def authenticator @authenticator end |
#connection_options ⇒ Hash
Returns Optionals. Options to pass to Faraday.
57 58 59 |
# File 'lib/admincredible/configuration.rb', line 57 def @connection_options end |
#consumer_key ⇒ String
Returns Optional. OAuth Consumer Key.
32 33 34 |
# File 'lib/admincredible/configuration.rb', line 32 def consumer_key @consumer_key end |
#consumer_secret ⇒ String
Returns Optional. OAuth Consumer Secret.
37 38 39 |
# File 'lib/admincredible/configuration.rb', line 37 def consumer_secret @consumer_secret end |
#direct_endpoint ⇒ String
Returns Optional. The direct endpoint to the component. Defaults to ‘/components/com_admincredible/direct.php’.
14 15 16 |
# File 'lib/admincredible/configuration.rb', line 14 def direct_endpoint @direct_endpoint end |
#logger ⇒ Logger
Returns Optional. An instance of an Logger or can be set to true to enable default logger.
73 74 75 |
# File 'lib/admincredible/configuration.rb', line 73 def logger @logger end |
#main_endpoint ⇒ String
Returns Optional. The main endpoint (frontend) for the component. Defaults to ‘/index.php?option=com_admincredible&view=authorize’.
19 20 21 |
# File 'lib/admincredible/configuration.rb', line 19 def main_endpoint @main_endpoint end |
#oauth_callback ⇒ String
Returns Optional. OAuth callback URL.
51 52 53 |
# File 'lib/admincredible/configuration.rb', line 51 def oauth_callback @oauth_callback end |
#step_after_seconds ⇒ Integer
Returns Optional. How quickly do we step an Akeeba restoration script? Defaults to 1 second.
68 69 70 |
# File 'lib/admincredible/configuration.rb', line 68 def step_after_seconds @step_after_seconds end |
#token ⇒ String
Returns Optional. OAuth Token.
42 43 44 |
# File 'lib/admincredible/configuration.rb', line 42 def token @token end |
#token_secret ⇒ String
Returns Optional. OAuth Token Secret.
47 48 49 |
# File 'lib/admincredible/configuration.rb', line 47 def token_secret @token_secret end |
#url ⇒ String
Returns the url with the endpoint
8 9 10 |
# File 'lib/admincredible/configuration.rb', line 8 def url @url end |
Instance Method Details
#oauth? ⇒ Boolean
82 83 84 |
# File 'lib/admincredible/configuration.rb', line 82 def oauth? return true if @consumer_secret || @authenticator == :oauth end |
#oauth_options ⇒ Object
106 107 108 109 110 111 112 113 |
# File 'lib/admincredible/configuration.rb', line 106 def return { :consumer_key => @consumer_key, :consumer_secret => @consumer_secret, :token => @token, :token_secret => @token_secret } end |
#raw_url ⇒ String
Returns the raw url that was set during configuration of the client
102 103 104 |
# File 'lib/admincredible/configuration.rb', line 102 def raw_url return @url end |