Class: Itly::Plugin::Amplitude::CallOptions
- Inherits:
-
Itly::PluginCallOptions
- Object
- Itly::PluginCallOptions
- Itly::Plugin::Amplitude::CallOptions
- Defined in:
- lib/itly/plugin/amplitude/call_options.rb
Overview
Amplitude specific plugin options class
Constant Summary collapse
- PROPS =
%w[device_id time groups app_version platform os_name os_version device_brand device_manufacturer device_model carrier country region city dma language price quantity revenue productId revenueType location_lat location_lng ip idfa idfv adid android_id event_id session_id insert_id].freeze
Instance Method Summary collapse
-
#to_hash ⇒ Hash
Return all properties to be passed to the client While excluding the ‘callback` property.
-
#to_s ⇒ String
Get the plugin description, for logs.
Instance Method Details
#to_hash ⇒ Hash
Return all properties to be passed to the client While excluding the ‘callback` property
33 34 35 |
# File 'lib/itly/plugin/amplitude/call_options.rb', line 33 def to_hash PROPS.each_with_object({}) { |prop, hash| hash[prop.to_sym] = send(prop) unless send(prop).nil? } end |
#to_s ⇒ String
Get the plugin description, for logs
42 43 44 45 46 |
# File 'lib/itly/plugin/amplitude/call_options.rb', line 42 def to_s class_name = self.class.name.split('::').last props = PROPS.collect { |prop| " #{prop}: #{send prop}" unless send(prop).nil? }.compact "#<Amplitude::#{class_name} callback: #{callback.nil? ? 'nil' : 'provided'}#{props.join}>" end |