Class: ActiveSpy::Configuration
- Inherits:
-
Object
- Object
- ActiveSpy::Configuration
- Defined in:
- lib/active_spy/configuration.rb
Overview
Defines a class to hold the configuration used to send events.
Class Method Summary collapse
-
.development_mode(mode = nil, options = nil) ⇒ Boolean
Set if the gem is in development mode or not.
-
.development_mode! ⇒ Object
Imperative method to set development mode.
-
.event_host(host = nil) ⇒ String
Set the default event-runner host.
-
.event_port(port = nil) ⇒ String
Set the default event-runner port.
-
.event_settings ⇒ Hash
See how are the event settings.
-
.event_verify_ssl(event_verify_ssl = nil) ⇒ String
Set the default event-tunner verify_ssl mode.
-
.host(host = nil) ⇒ String
Set the application host.
-
.name(name = nil) ⇒ String
Set the application name.
-
.port(port = nil) ⇒ String
Set the application port.
-
.settings ⇒ Hash
See how are the settings.
-
.skip_validations ⇒ Object
Simple reader for
skip_validations
attribute.
Class Method Details
.development_mode(mode = nil, options = nil) ⇒ Boolean
Set if the gem is in development mode or not.
61 62 63 64 65 66 67 |
# File 'lib/active_spy/configuration.rb', line 61 def development_mode(mode = nil, = nil) unless mode.nil? @development_mode = mode @skip_validations = [:skip_validations] if .present? end @development_mode end |
.development_mode! ⇒ Object
Imperative method to set development mode.
77 78 79 |
# File 'lib/active_spy/configuration.rb', line 77 def development_mode! @development_mode = true end |
.event_host(host = nil) ⇒ String
Set the default event-runner host
41 42 43 44 |
# 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) ⇒ String
Set the default event-runner port
86 87 88 89 |
# File 'lib/active_spy/configuration.rb', line 86 def event_port(port = nil) @event_port = port unless port.nil? @event_port end |
.event_settings ⇒ Hash
See how are the event settings
101 102 103 |
# 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) ⇒ String
Set the default event-tunner verify_ssl mode
51 52 53 54 |
# 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) ⇒ String
Set the application host
11 12 13 14 |
# File 'lib/active_spy/configuration.rb', line 11 def host(host = nil) @host = host unless host.nil? @host end |
.name(name = nil) ⇒ String
Set the application name
31 32 33 34 |
# File 'lib/active_spy/configuration.rb', line 31 def name(name = nil) @name = name unless name.nil? @name end |
.port(port = nil) ⇒ String
Set the application port
21 22 23 24 |
# File 'lib/active_spy/configuration.rb', line 21 def port(port = nil) @port = port unless port.nil? @port end |
.settings ⇒ Hash
See how are the settings
94 95 96 |
# File 'lib/active_spy/configuration.rb', line 94 def settings { name: @name, hostname: @host, port: @port } end |
.skip_validations ⇒ Object
Simple reader for skip_validations
attribute.
71 72 73 |
# File 'lib/active_spy/configuration.rb', line 71 def skip_validations @skip_validations end |