Class: Config

Inherits:
Object
  • Object
show all
Defined in:
lib/wattics-api-client/config.rb

Constant Summary collapse

PRODUCTION =
'https://web-collector.wattics.com/measurements/v2/unifiedjson/'.freeze
DEVELOPMENT =
'https://dev-web-collector.wattics.com/measurements/v2/unifiedjson/'.freeze
TEST =
'http://localhost:8080/measurements/v2/unifiedjson/'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment, username, password) ⇒ Config

Returns a new instance of Config.



6
7
8
9
10
11
# File 'lib/wattics-api-client/config.rb', line 6

def initialize(environment, username, password)
  @environment = environment
  @uri = environment(environment)
  @username = username
  @password = password
end

Instance Attribute Details

#environment(environment) ⇒ Object (readonly)

Returns the value of attribute environment.



2
3
4
# File 'lib/wattics-api-client/config.rb', line 2

def environment
  @environment
end

#passwordObject (readonly)

Returns the value of attribute password.



2
3
4
# File 'lib/wattics-api-client/config.rb', line 2

def password
  @password
end

#uriObject (readonly)

Returns the value of attribute uri.



2
3
4
# File 'lib/wattics-api-client/config.rb', line 2

def uri
  @uri
end

#usernameObject (readonly)

Returns the value of attribute username.



2
3
4
# File 'lib/wattics-api-client/config.rb', line 2

def username
  @username
end