Class: Fairdom::OpenbisApi::Authentication

Inherits:
OpenbisQuery show all
Defined in:
lib/fairdom/openbis_api/authentication.rb

Instance Attribute Summary collapse

Attributes inherited from OpenbisQuery

#is_test, #token

Instance Method Summary collapse

Methods inherited from OpenbisQuery

#command_option_key, #query

Constructor Details

#initialize(username, password, as_endpoint, is_test = false) ⇒ Authentication

Returns a new instance of Authentication.



6
7
8
9
10
11
# File 'lib/fairdom/openbis_api/authentication.rb', line 6

def initialize(username, password, as_endpoint, is_test = false)
  @username = username
  @password = password
  @as_endpoint = as_endpoint
  @is_test = is_test
end

Instance Attribute Details

#as_endpointObject (readonly)

Returns the value of attribute as_endpoint.



4
5
6
# File 'lib/fairdom/openbis_api/authentication.rb', line 4

def as_endpoint
  @as_endpoint
end

#passwordObject (readonly)

Returns the value of attribute password.



4
5
6
# File 'lib/fairdom/openbis_api/authentication.rb', line 4

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



4
5
6
# File 'lib/fairdom/openbis_api/authentication.rb', line 4

def username
  @username
end

Instance Method Details

#execute_command(_options) ⇒ Object



17
18
19
# File 'lib/fairdom/openbis_api/authentication.rb', line 17

def execute_command(_options)
  java_root_command
end

#loginObject



13
14
15
# File 'lib/fairdom/openbis_api/authentication.rb', line 13

def 
  execute []
end

#root_command_optionsObject



21
22
23
# File 'lib/fairdom/openbis_api/authentication.rb', line 21

def root_command_options
  " -account '{%username%:%#{username}%\,%password%:%#{password}%}' -endpoints '{%as%:%#{as_endpoint}%,%is_test%:%#{is_test}%}'"
end