Class: SpeedGun::Config

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

Constant Summary collapse

DEFAULT_PREFIX =
'/speed_gun'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



24
25
26
27
28
29
30
31
32
33
# File 'lib/speed_gun/config.rb', line 24

def initialize
  @enabled = true
  @webapp = true
  @store = SpeedGun::Store::MemoryStore.new
  @prefix = DEFAULT_PREFIX
  @logger = ::Logger.new(STDOUT)
  @skip_paths = ['/favicon.ico']
  @lineprof_paths = []
  @ignored_profilers = []
end

Instance Attribute Details

#enabledBoolean

Returns Enabled SpeedGun.

Returns:

  • (Boolean)

    Enabled SpeedGun



10
11
12
# File 'lib/speed_gun/config.rb', line 10

def enabled
  @enabled
end

#ignored_profilersObject

Returns the value of attribute ignored_profilers.



22
23
24
# File 'lib/speed_gun/config.rb', line 22

def ignored_profilers
  @ignored_profilers
end

#lineprof_pathsObject

Returns the value of attribute lineprof_paths.



21
22
23
# File 'lib/speed_gun/config.rb', line 21

def lineprof_paths
  @lineprof_paths
end

#loggerObject

Returns the value of attribute logger.



18
19
20
# File 'lib/speed_gun/config.rb', line 18

def logger
  @logger
end

#prefixString

Returns Console and API endpoint prefix.

Returns:

  • (String)

    Console and API endpoint prefix



16
17
18
# File 'lib/speed_gun/config.rb', line 16

def prefix
  @prefix
end

#skip_pathsObject

Returns the value of attribute skip_paths.



20
21
22
# File 'lib/speed_gun/config.rb', line 20

def skip_paths
  @skip_paths
end

#storeObject

Returns the value of attribute store.



13
14
15
# File 'lib/speed_gun/config.rb', line 13

def store
  @store
end

#webappObject

Returns the value of attribute webapp.



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

def webapp
  @webapp
end

Instance Method Details

#disabled?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/speed_gun/config.rb', line 40

def disabled?
  !enabled?
end

#enabled?Boolean

Returns Enabled SpeedGun.

Returns:

  • (Boolean)

    Enabled SpeedGun



36
37
38
# File 'lib/speed_gun/config.rb', line 36

def enabled?
  enabled
end