class ActiveSpy::Configuration

Defines a class to hold the configuration used to send events.

Public Class Methods

development_mode(mode = nil, options = nil) click to toggle source

Set if the gem is in development mode or not.

@param [Boolean] development moded state to set

@return [Boolean] development moded state to set

# File lib/active_spy/configuration.rb, line 61
def development_mode(mode = nil, options = nil)
  unless mode.nil?
    @development_mode = mode
    @skip_validations = options[:skip_validations] if options.present?
  end
  @development_mode
end
development_mode!() click to toggle source

Imperative method to set development mode.

# File lib/active_spy/configuration.rb, line 77
def development_mode!
  @development_mode = true
end
event_host(host = nil) click to toggle source

Set the default event-runner host

@param [String] host to set

@return [String] the host set

# File lib/active_spy/configuration.rb, line 41
def event_host(host = nil)
  @event_host = host unless host.nil?
  @event_host
end
event_port(port = nil) click to toggle source

Set the default event-runner port

@param [String] port to set

@return [String] the port set

# File lib/active_spy/configuration.rb, line 86
def event_port(port = nil)
  @event_port = port unless port.nil?
  @event_port
end
event_settings() click to toggle source

See how are the event settings

@return [Hash] actual event settings

# File lib/active_spy/configuration.rb, line 101
def event_settings
  { host: @event_host, port: @event_port, verify_ssl: @event_verify_ssl }
end
event_verify_ssl(event_verify_ssl = nil) click to toggle source

Set the default event-tunner verify_ssl mode

@param [String] host to set

@return [String] the host set

# File lib/active_spy/configuration.rb, line 51
def event_verify_ssl(event_verify_ssl = nil)
  @event_verify_ssl = event_verify_ssl unless event_verify_ssl.nil?
  @event_verify_ssl
end
host(host = nil) click to toggle source

Set the application host

@param [String] host to set

@return [String] the host set

# File lib/active_spy/configuration.rb, line 11
def host(host = nil)
  @host = host unless host.nil?
  @host
end
name(name = nil) click to toggle source

Set the application name

@param [String] name to set

@return [String] the name set

# File lib/active_spy/configuration.rb, line 31
def name(name = nil)
  @name = name unless name.nil?
  @name
end
port(port = nil) click to toggle source

Set the application port

@param [String] port to set

@return [String] the port set

# File lib/active_spy/configuration.rb, line 21
def port(port = nil)
  @port = port unless port.nil?
  @port
end
settings() click to toggle source

See how are the settings

@return [Hash] actual settings

# File lib/active_spy/configuration.rb, line 94
def settings
  { name: @name, hostname: @host, port: @port }
end
skip_validations() click to toggle source

Simple reader for skip_validations attribute.

# File lib/active_spy/configuration.rb, line 71
def skip_validations
  @skip_validations
end