Class: OpenGraphPlus::Configuration
- Inherits:
-
Object
- Object
- OpenGraphPlus::Configuration
- Defined in:
- lib/opengraphplus/configuration.rb
Instance Method Summary collapse
- #api_key ⇒ Object
- #api_key=(value) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 |
# File 'lib/opengraphplus/configuration.rb', line 5 def initialize @api_key = nil end |
Instance Method Details
#api_key ⇒ Object
9 10 11 |
# File 'lib/opengraphplus/configuration.rb', line 9 def api_key @api_key or warn "[OpenGraphPlus] API key not configured. Set OpenGraphPlus.configuration.api_key to enable automatic Open Graph image generation." end |
#api_key=(value) ⇒ Object
13 14 15 |
# File 'lib/opengraphplus/configuration.rb', line 13 def api_key=(value) @api_key = value.is_a?(APIKey) ? value : APIKey.parse(value) end |