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.
158 159 160 |
# File 'lib/omnigollum.rb', line 158 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
184 |
# File 'lib/omnigollum.rb', line 184 def method_missing(*args); end |
Class Attribute Details
.default_options ⇒ Object
Returns the value of attribute default_options.
122 123 124 |
# File 'lib/omnigollum.rb', line 122 def @default_options end |
Instance Attribute Details
#default_options ⇒ Object
Returns the value of attribute default_options.
121 122 123 |
# File 'lib/omnigollum.rb', line 121 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
176 177 178 |
# File 'lib/omnigollum.rb', line 176 def eval_omniauth_config(&block) self.instance_eval(&block) end |
#provider(name, *args) ⇒ Object
Register provider name
name - Provider symbol args - Arbitrary arguments
166 167 168 |
# File 'lib/omnigollum.rb', line 166 def provider(name, *args) @default_options[:provider_names].push name end |