Class: Unleash::Admin::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/unleash/admin/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Configuration

Returns a new instance of Configuration.

Yields:

  • (_self)

Yield Parameters:



8
9
10
11
12
13
14
15
# File 'lib/unleash/admin/configuration.rb', line 8

def initialize
  @admin_api_key =  ENV.key?('UNLEASH_ADMIN_API_KEY') ? ENV['UNLEASH_ADMIN_API_KEY'] : 'dummy'
  @server_url =  ENV.key?('UNLEASH_SERVER_URL') ? ENV['UNLEASH_SERVER_URL'] : 'http://localhost:4242'
  @project = ENV.key?('UNLEASH_PROJECT_NAME') ? ENV['UNLEASH_PROJECT_NAME'] : 'default' 
  @environment = ENV.key?('UNLEASH_ENVIRONMENT') ? ENV['UNLEASH_ENVIRONMENT'] : 'development'
  
  yield(self) if block_given?
end

Instance Attribute Details

#admin_api_keyObject

Returns the value of attribute admin_api_key.



6
7
8
# File 'lib/unleash/admin/configuration.rb', line 6

def admin_api_key
  @admin_api_key
end

#environmentObject

Returns the value of attribute environment.



6
7
8
# File 'lib/unleash/admin/configuration.rb', line 6

def environment
  @environment
end

#projectObject

Returns the value of attribute project.



6
7
8
# File 'lib/unleash/admin/configuration.rb', line 6

def project
  @project
end

#server_urlObject

Returns the value of attribute server_url.



6
7
8
# File 'lib/unleash/admin/configuration.rb', line 6

def server_url
  @server_url
end