Class: TensorBuzz::Api::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/tensorbuzz/api/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



9
10
11
12
13
# File 'lib/tensorbuzz/api/configuration.rb', line 9

def initialize
  @open_timeout = 2
  @post_url = 'https://server.tensorbuzz.com/errors/reports'
  @read_timeout = 5
end

Instance Attribute Details

#auth_tokenObject

Returns the value of attribute auth_token.



6
7
8
# File 'lib/tensorbuzz/api/configuration.rb', line 6

def auth_token
  @auth_token
end

#environmentObject

Returns the value of attribute environment.



6
7
8
# File 'lib/tensorbuzz/api/configuration.rb', line 6

def environment
  @environment
end

#hostnameObject

Returns the value of attribute hostname.



6
7
8
# File 'lib/tensorbuzz/api/configuration.rb', line 6

def hostname
  @hostname
end

#loggerObject

Returns the value of attribute logger.



6
7
8
# File 'lib/tensorbuzz/api/configuration.rb', line 6

def logger
  @logger
end

#open_timeoutObject

Returns the value of attribute open_timeout.



6
7
8
# File 'lib/tensorbuzz/api/configuration.rb', line 6

def open_timeout
  @open_timeout
end

#post_urlObject

Returns the value of attribute post_url.



6
7
8
# File 'lib/tensorbuzz/api/configuration.rb', line 6

def post_url
  @post_url
end

#project_idObject

Returns the value of attribute project_id.



6
7
8
# File 'lib/tensorbuzz/api/configuration.rb', line 6

def project_id
  @project_id
end

#read_timeoutObject

Returns the value of attribute read_timeout.



6
7
8
# File 'lib/tensorbuzz/api/configuration.rb', line 6

def read_timeout
  @read_timeout
end

#releaseObject

Returns the value of attribute release.



6
7
8
# File 'lib/tensorbuzz/api/configuration.rb', line 6

def release
  @release
end

Instance Method Details

#validate!Object

Raises:

  • (ArgumentError)


15
16
17
18
# File 'lib/tensorbuzz/api/configuration.rb', line 15

def validate!
  raise ArgumentError, 'TensorBuzz auth_token is required' if auth_token.to_s.empty?
  raise ArgumentError, 'TensorBuzz project_id is required' if project_id.to_s.empty?
end