Class: RollbarConfig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ RollbarConfig

Returns a new instance of RollbarConfig.



6
7
8
9
10
11
12
13
# File 'lib/production_toolkit/rollbar_configurator.rb', line 6

def initialize(config)
  @enabled = config.fetch(:enabled, false)
  if enabled?
    @server_token = config.fetch(:server_token)
    @client_token = config.fetch(:client_token)
    @environment  = config.fetch(:environment)
  end
end

Instance Attribute Details

#client_tokenObject (readonly)

Returns the value of attribute client_token.



4
5
6
# File 'lib/production_toolkit/rollbar_configurator.rb', line 4

def client_token
  @client_token
end

#environmentObject (readonly)

Returns the value of attribute environment.



4
5
6
# File 'lib/production_toolkit/rollbar_configurator.rb', line 4

def environment
  @environment
end

#server_tokenObject (readonly)

Returns the value of attribute server_token.



4
5
6
# File 'lib/production_toolkit/rollbar_configurator.rb', line 4

def server_token
  @server_token
end

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/production_toolkit/rollbar_configurator.rb', line 15

def enabled?
  @enabled
end