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'
SUMMARY_KIND =
'summary'

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ EventOutputFormatter

Returns a new instance of EventOutputFormatter.



448
449
450
# File 'lib/ldclient-rb/events.rb', line 448

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.



453
454
455
456
457
458
459
# File 'lib/ldclient-rb/events.rb', line 453

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