Class: Admincredible::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/admincredible/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

#adapterMixed

Returns Optional. Faraday adapter.

Returns:

  • (Mixed)

    Optional. Faraday adapter



62
63
64
# File 'lib/admincredible/configuration.rb', line 62

def adapter
  @adapter
end

#authenticatorSymbol

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.

Returns:

  • (Symbol)

    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_optionsHash

Returns Optionals. Options to pass to Faraday.

Returns:

  • (Hash)

    Optionals. Options to pass to Faraday



57
58
59
# File 'lib/admincredible/configuration.rb', line 57

def connection_options
  @connection_options
end

#consumer_keyString

Returns Optional. OAuth Consumer Key.

Returns:

  • (String)

    Optional. OAuth Consumer Key.



32
33
34
# File 'lib/admincredible/configuration.rb', line 32

def consumer_key
  @consumer_key
end

#consumer_secretString

Returns Optional. OAuth Consumer Secret.

Returns:

  • (String)

    Optional. OAuth Consumer Secret.



37
38
39
# File 'lib/admincredible/configuration.rb', line 37

def consumer_secret
  @consumer_secret
end

#direct_endpointString

Returns Optional. The direct endpoint to the component. Defaults to ‘/components/com_admincredible/direct.php’.

Returns:

  • (String)

    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

#loggerLogger

Returns Optional. An instance of an Logger or can be set to true to enable default logger.

Returns:

  • (Logger)

    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_endpointString

Returns Optional. The main endpoint (frontend) for the component. Defaults to ‘/index.php?option=com_admincredible&view=authorize’.

Returns:

  • (String)

    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_callbackString

Returns Optional. OAuth callback URL.

Returns:

  • (String)

    Optional. OAuth callback URL.



51
52
53
# File 'lib/admincredible/configuration.rb', line 51

def oauth_callback
  @oauth_callback
end

#step_after_secondsInteger

Returns Optional. How quickly do we step an Akeeba restoration script? Defaults to 1 second.

Returns:

  • (Integer)

    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

#tokenString

Returns Optional. OAuth Token.

Returns:

  • (String)

    Optional. OAuth Token.



42
43
44
# File 'lib/admincredible/configuration.rb', line 42

def token
  @token
end

#token_secretString

Returns Optional. OAuth Token Secret.

Returns:

  • (String)

    Optional. OAuth Token Secret.



47
48
49
# File 'lib/admincredible/configuration.rb', line 47

def token_secret
  @token_secret
end

#urlString

Returns the url with the endpoint

Returns:



8
9
10
# File 'lib/admincredible/configuration.rb', line 8

def url
  @url
end

Instance Method Details

#oauth?Boolean

Returns:

  • (Boolean)


82
83
84
# File 'lib/admincredible/configuration.rb', line 82

def oauth?
  return true if @consumer_secret || @authenticator == :oauth
end

#oauth_optionsObject



106
107
108
109
110
111
112
113
# File 'lib/admincredible/configuration.rb', line 106

def oauth_options
  return {
    :consumer_key    => @consumer_key,
    :consumer_secret => @consumer_secret,
    :token           => @token,
    :token_secret    => @token_secret
  }
end

#raw_urlString

Returns the raw url that was set during configuration of the client

Returns:



102
103
104
# File 'lib/admincredible/configuration.rb', line 102

def raw_url
  return @url
end