Class: Cpaas::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/cpaas-sdk/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#base_urlObject

Returns the value of attribute base_url.



9
10
11
# File 'lib/cpaas-sdk/config.rb', line 9

def base_url
  @base_url
end

#client_idObject

Returns the value of attribute client_id.



5
6
7
# File 'lib/cpaas-sdk/config.rb', line 5

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



6
7
8
# File 'lib/cpaas-sdk/config.rb', line 6

def client_secret
  @client_secret
end

#emailObject

Returns the value of attribute email.



7
8
9
# File 'lib/cpaas-sdk/config.rb', line 7

def email
  @email
end

#passwordObject

Returns the value of attribute password.



8
9
10
# File 'lib/cpaas-sdk/config.rb', line 8

def password
  @password
end

Instance Method Details

#validateObject

Raises:

  • (ArgumentError)


11
12
13
14
15
16
17
# File 'lib/cpaas-sdk/config.rb', line 11

def validate
  raise ArgumentError.new('`client_id` cannot be nil')  if client_id.nil?

  raise ArgumentError.new('`clientSecret` or `email/password` cannot be nil')  if client_secret.nil? && (email.nil? || password.nil?)

  true
end