Class: Echochamber::Credentials

Inherits:
Hash
  • Object
show all
Includes:
Validatable
Defined in:
lib/echochamber/credentials.rb

Instance Method Summary collapse

Methods included from Validatable

#require_exactly_one, #require_keys, #validate_field

Constructor Details

#initialize(app_id, app_secret, api_key, email, password) ⇒ Echochamber::Credentials

Builds a Credentials object

Parameters:

  • app_id (String)

    Application key

  • app_secret (String)

    Application secret

  • api_key (String)

    API Key

  • email (String)

    User email

  • password (String)

    User password


14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/echochamber/credentials.rb', line 14

def initialize(app_id, app_secret, api_key, email, password)

  merge!(
  {
    applicationCredentials:  {
    applicationId: app_id,
    applicationSecret: app_secret
  },
    userCredentials: {
    apiKey: api_key,
    email: email,
    password: password 
  }
  }
  )
end