Class: ZuoraObservability::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/zuora_observability/configuration.rb

Overview

Global configuration that can be set in a Rails initializer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



9
10
11
12
13
14
15
# File 'lib/zuora_observability/configuration.rb', line 9

def initialize
  @custom_payload_hooks = []
  @zecs_service_hook = nil
  # NOTE(hartley): this checks the var for presence rather than value to
  # align with how Rails does RAILS_LOG_TO_STDOUT
  @json_logging = ENV['ZUORA_JSON_LOGGING'].present? ? true : !(Rails.env.development? || Rails.env.test?)
end

Instance Attribute Details

#custom_payload_hooksObject (readonly)

Returns the value of attribute custom_payload_hooks.



6
7
8
# File 'lib/zuora_observability/configuration.rb', line 6

def custom_payload_hooks
  @custom_payload_hooks
end

#json_loggingObject

Returns the value of attribute json_logging.



7
8
9
# File 'lib/zuora_observability/configuration.rb', line 7

def json_logging
  @json_logging
end

#zecs_service_hookObject

Returns the value of attribute zecs_service_hook.



7
8
9
# File 'lib/zuora_observability/configuration.rb', line 7

def zecs_service_hook
  @zecs_service_hook
end

Instance Method Details

#add_custom_payload_hook(&block) ⇒ Object



17
18
19
# File 'lib/zuora_observability/configuration.rb', line 17

def add_custom_payload_hook(&block)
  custom_payload_hooks << block
end