Class: Omnigollum::Config
- Inherits:
-
Object
- Object
- Omnigollum::Config
- Defined in:
- lib/omnigollum.rb
Overview
Config class provides default values for omnigollum configuration, and an array of all providers which have been enabled if a omniauth config block is passed to eval_omniauth_config.
Class Attribute Summary collapse
-
.default_options ⇒ Object
Returns the value of attribute default_options.
Instance Attribute Summary collapse
-
#default_options ⇒ Object
Returns the value of attribute default_options.
Instance Method Summary collapse
-
#eval_omniauth_config(&block) ⇒ Object
Evaluate procedure calls in an omniauth config block/proc in the context of this class.
-
#initialize ⇒ Config
constructor
A new instance of Config.
-
#method_missing(*args) ⇒ Object
Catches missing methods we haven’t implemented, but which omniauth accepts in its config block.
-
#provider(name, *args) ⇒ Object
Register provider name.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
113 114 115 |
# File 'lib/omnigollum.rb', line 113 def initialize @default_options = self.class. end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
Catches missing methods we haven’t implemented, but which omniauth accepts in its config block.
args - Arbitrary list of arguments
139 |
# File 'lib/omnigollum.rb', line 139 def method_missing(*args); end |
Class Attribute Details
.default_options ⇒ Object
Returns the value of attribute default_options.
90 91 92 |
# File 'lib/omnigollum.rb', line 90 def @default_options end |
Instance Attribute Details
#default_options ⇒ Object
Returns the value of attribute default_options.
89 90 91 |
# File 'lib/omnigollum.rb', line 89 def @default_options end |
Instance Method Details
#eval_omniauth_config(&block) ⇒ Object
Evaluate procedure calls in an omniauth config block/proc in the context of this class.
This allows us to learn about omniauth config items that would otherwise be inaccessible.
block - Omniauth proc or block
131 132 133 |
# File 'lib/omnigollum.rb', line 131 def eval_omniauth_config(&block) self.instance_eval(&block) end |
#provider(name, *args) ⇒ Object
Register provider name
name - Provider symbol args - Arbitrary arguments
121 122 123 |
# File 'lib/omnigollum.rb', line 121 def provider(name, *args) @default_options[:provider_names].push name end |