class ActiveSpy::Configuration
Defines a class to hold the configuration used to send events.
Public Class Methods
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
Imperative method to set development mode.
# File lib/active_spy/configuration.rb, line 77 def development_mode! @development_mode = true end
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
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
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
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
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
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
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
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
Simple reader for skip_validations
attribute.
# File lib/active_spy/configuration.rb, line 71 def skip_validations @skip_validations end