Class: LaunchDarkly::EventOutputFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/ldclient-rb/events.rb

Constant Summary collapse

FEATURE_KIND =
'feature'
IDENTIFY_KIND =
'identify'
CUSTOM_KIND =
'custom'
INDEX_KIND =
'index'
DEBUG_KIND =
'debug'
MIGRATION_OP_KIND =
'migration_op'
SUMMARY_KIND =
'summary'

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ EventOutputFormatter

Returns a new instance of EventOutputFormatter.



461
462
463
# File 'lib/ldclient-rb/events.rb', line 461

def initialize(config)
  @context_filter = LaunchDarkly::Impl::ContextFilter.new(config.all_attributes_private, config.private_attributes)
end

Instance Method Details

#make_output_events(events, summary) ⇒ Object

Transforms events into the format used for event sending.



466
467
468
469
470
471
472
# File 'lib/ldclient-rb/events.rb', line 466

def make_output_events(events, summary)
  events_out = events.map { |e| make_output_event(e) }
  unless summary.counters.empty?
    events_out.push(make_summary_event(summary))
  end
  events_out
end