Class: Sygna::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/sygna/config.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

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

.instanceObject



6
7
8
# File 'lib/sygna/config.rb', line 6

def instance
  @instance ||= new
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



11
12
13
# File 'lib/sygna/config.rb', line 11

def api_key
  @api_key
end

#private_keyObject

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

Returns:

  • (Boolean)


19
20
21
# File 'lib/sygna/config.rb', line 19

def valid?
  !self.api_key.empty? && !self.private_key.empty? rescue false
end