Class: LeanTesting::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



21
22
23
24
25
26
27
28
29
30
# File 'lib/leantesting.rb', line 21

def initialize
	@accessToken = nil

	@auth			= OAuth2Handler.new(self)
	@user			= UserHandler.new(self)
	@projects		= ProjectsHandler.new(self)
	@bugs			= BugsHandler.new(self)
	@attachments	= AttachmentsHandler.new(self)
	@platform		= PlatformHandler.new(self)
end

Instance Attribute Details

#attachmentsObject (readonly)

Returns the value of attribute attachments.



11
12
13
# File 'lib/leantesting.rb', line 11

def attachments
  @attachments
end

#authObject (readonly)

Returns the value of attribute auth.



11
12
13
# File 'lib/leantesting.rb', line 11

def auth
  @auth
end

#bugsObject (readonly)

Returns the value of attribute bugs.



11
12
13
# File 'lib/leantesting.rb', line 11

def bugs
  @bugs
end

#debugReturnObject

Returns the value of attribute debugReturn.



19
20
21
# File 'lib/leantesting.rb', line 19

def debugReturn
  @debugReturn
end

#platformObject (readonly)

Returns the value of attribute platform.



11
12
13
# File 'lib/leantesting.rb', line 11

def platform
  @platform
end

#projectsObject (readonly)

Returns the value of attribute projects.



11
12
13
# File 'lib/leantesting.rb', line 11

def projects
  @projects
end

#userObject (readonly)

Returns the value of attribute user.



11
12
13
# File 'lib/leantesting.rb', line 11

def user
  @user
end

Instance Method Details

#attachToken(accessToken) ⇒ Object

Function to attach new token to SDK Client instance. Token changes are dynamic; all objects/entities originating from an instance which has had its token updated will utilize the new token automatically.

Arguments: accessToken String – the string of the token to be attached

Exceptions: SDKInvalidArgException if provided accessToken param is not a string



57
58
59
60
61
62
# File 'lib/leantesting.rb', line 57

def attachToken(accessToken)
	if !accessToken.is_a? String
		raise SDKInvalidArgException, '`accessToken` must be a string'
	end
	@accessToken = accessToken
end

#getCurrentTokenObject

Function to retrieve curently attached token.

Returns: String – if a token is attached boolean – if no token is attached



39
40
41
42
43
44
45
# File 'lib/leantesting.rb', line 39

def getCurrentToken
	if !@accessToken
		return false
	end

	@accessToken
end