Class: LaunchDarkly::EventSerializer
- Inherits:
-
Object
- Object
- LaunchDarkly::EventSerializer
- Defined in:
- lib/ldclient-rb/event_serializer.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ EventSerializer
constructor
A new instance of EventSerializer.
- #serialize_events(events) ⇒ Object
Constructor Details
#initialize(config) ⇒ EventSerializer
Returns a new instance of EventSerializer.
5 6 7 8 |
# File 'lib/ldclient-rb/event_serializer.rb', line 5 def initialize(config) @all_attributes_private = config.all_attributes_private @private_attribute_names = Set.new(config.private_attribute_names.map(&:to_sym)) end |
Instance Method Details
#serialize_events(events) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/ldclient-rb/event_serializer.rb', line 10 def serialize_events(events) events.map { |event| Hash[event.map { |key, value| [key, (key.to_sym == :user) ? transform_user_props(value) : value] }] }.to_json end |