Module: PatientZero::Configurable

Included in:
PatientZero
Defined in:
lib/patient_zero/configurable.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



3
4
5
# File 'lib/patient_zero/configurable.rb', line 3

def api_key
  @api_key
end

#connectionObject

Returns the value of attribute connection.



3
4
5
# File 'lib/patient_zero/configurable.rb', line 3

def connection
  @connection
end

#emailObject

Returns the value of attribute email.



3
4
5
# File 'lib/patient_zero/configurable.rb', line 3

def email
  @email
end

#passwordObject

Returns the value of attribute password.



3
4
5
# File 'lib/patient_zero/configurable.rb', line 3

def password
  @password
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/patient_zero/configurable.rb', line 3

def url
  @url
end

Class Method Details

.extended(base) ⇒ Object



5
6
7
# File 'lib/patient_zero/configurable.rb', line 5

def self.extended(base)
  base.reset
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



9
10
11
12
# File 'lib/patient_zero/configurable.rb', line 9

def configure
  yield self
  self
end

#resetObject



14
15
16
17
18
19
# File 'lib/patient_zero/configurable.rb', line 14

def reset
  self.url      = 'https://app.viralheat.com'
  self.api_key  = ENV['VIRAL_HEAT_API_KEY']
  self.email    = ENV['VIRAL_HEAT_EMAIL']
  self.password = ENV['VIRAL_HEAT_PASSWORD']
end