Class: SqlMetrics::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/sql_metrics/config.rb', line 11

def initialize

  self.host = nil
  self.port = 5432
  self.options = nil
  self.tty = nil
  self.db_name = nil
  self.user = nil
  self.password = nil
  self.database_schema = 'public'
  self.event_table_name = 'events'

  self.bots_regex = /Googlebot|Pingdom|bing|Yahoo|Amazon|Twitter|Yandex|baidu|majestic12/i

  self.logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
end

Instance Attribute Details

#bots_regexObject

Returns the value of attribute bots_regex.



8
9
10
# File 'lib/sql_metrics/config.rb', line 8

def bots_regex
  @bots_regex
end

#database_schemaObject

Returns the value of attribute database_schema.



8
9
10
# File 'lib/sql_metrics/config.rb', line 8

def database_schema
  @database_schema
end

#db_nameObject

Returns the value of attribute db_name.



8
9
10
# File 'lib/sql_metrics/config.rb', line 8

def db_name
  @db_name
end

#event_table_nameObject

Returns the value of attribute event_table_name.



8
9
10
# File 'lib/sql_metrics/config.rb', line 8

def event_table_name
  @event_table_name
end

#hostObject

Returns the value of attribute host.



8
9
10
# File 'lib/sql_metrics/config.rb', line 8

def host
  @host
end

#loggerObject

Returns the value of attribute logger.



8
9
10
# File 'lib/sql_metrics/config.rb', line 8

def logger
  @logger
end

#optionsObject

Returns the value of attribute options.



8
9
10
# File 'lib/sql_metrics/config.rb', line 8

def options
  @options
end

#passwordObject

Returns the value of attribute password.



8
9
10
# File 'lib/sql_metrics/config.rb', line 8

def password
  @password
end

#portObject

Returns the value of attribute port.



8
9
10
# File 'lib/sql_metrics/config.rb', line 8

def port
  @port
end

#ttyObject

Returns the value of attribute tty.



8
9
10
# File 'lib/sql_metrics/config.rb', line 8

def tty
  @tty
end

#userObject

Returns the value of attribute user.



8
9
10
# File 'lib/sql_metrics/config.rb', line 8

def user
  @user
end