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.



474
475
476
# File 'lib/ldclient-rb/events.rb', line 474

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.



479
480
481
482
483
484
485
# File 'lib/ldclient-rb/events.rb', line 479

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