Class: Rallycat::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/rallycat/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username = nil, password = nil) ⇒ Connection

Returns a new instance of Connection.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rallycat/connection.rb', line 12

def initialize(username=nil, password=nil)
  @username = username
  @password = password

  config = parse_config

  begin
    @api = RallyRestAPI.new \
     base_url: 'https://rally1.rallydev.com/slm',
     username: config.fetch('username'),
     password: config.fetch('password'),
     logger: Logger.new(nil)

  rescue Rally::NotAuthenticatedError
    raise InvalidCredentialsError.new('Your Rally credentials are invalid.')
  end
end

Instance Attribute Details

#apiObject (readonly)

Returns the value of attribute api.



10
11
12
# File 'lib/rallycat/connection.rb', line 10

def api
  @api
end