Class: Sygna::Config
- Inherits:
-
Object
- Object
- Sygna::Config
- Defined in:
- lib/sygna/config.rb
Class Attribute Summary collapse
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#private_key ⇒ Object
Returns the value of attribute private_key.
Instance Method Summary collapse
-
#initialize(config = {}) ⇒ Config
constructor
A new instance of Config.
- #valid? ⇒ Boolean
Constructor Details
#initialize(config = {}) ⇒ Config
Returns a new instance of Config.
14 15 16 17 |
# File 'lib/sygna/config.rb', line 14 def initialize(config = {}) self.api_key = config[:api_key] self.private_key = config[:private_key] end |
Class Attribute Details
.instance ⇒ Object
6 7 8 |
# File 'lib/sygna/config.rb', line 6 def instance @instance ||= new end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
11 12 13 |
# File 'lib/sygna/config.rb', line 11 def api_key @api_key end |
#private_key ⇒ Object
Returns the value of attribute private_key.
12 13 14 |
# File 'lib/sygna/config.rb', line 12 def private_key @private_key end |
Instance Method Details
#valid? ⇒ Boolean
19 20 21 |
# File 'lib/sygna/config.rb', line 19 def valid? !self.api_key.empty? && !self.private_key.empty? rescue false end |