Class: CleverTap::Entity
- Inherits:
-
Object
- Object
- CleverTap::Entity
- Defined in:
- lib/clever_tap/entity.rb
Constant Summary collapse
- ALLOWED_IDENTITIES =
%w(objectId FBID GPID).freeze
- IDENTITY_STRING =
'identity'.freeze
- TIMESTAMP_STRING =
'ts'.freeze
- TYPE_KEY_STRING =
'type'.freeze
- UPLOAD_LIMIT =
'Needs child class value'.freeze
- TYPE_VALUE_STRING =
'Needs child class value'.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(**args) ⇒ Entity
constructor
A new instance of Entity.
- #to_h ⇒ Object
Constructor Details
#initialize(**args) ⇒ Entity
Returns a new instance of Entity.
32 33 34 35 36 |
# File 'lib/clever_tap/entity.rb', line 32 def initialize(**args) @data = args[:data] @identity = choose_identity(args) @timestamp = (args) end |
Class Method Details
.all_same_type?(items) ⇒ Boolean
27 28 29 |
# File 'lib/clever_tap/entity.rb', line 27 def all_same_type?(items) items.all? { |i| i.class == self } end |
.upload_limit ⇒ Object
23 24 25 |
# File 'lib/clever_tap/entity.rb', line 23 def upload_limit self::UPLOAD_LIMIT end |
Instance Method Details
#to_h ⇒ Object
38 39 40 41 42 43 |
# File 'lib/clever_tap/entity.rb', line 38 def to_h put_identity_pair .merge() .merge(put_type_pair) .merge(put_data) end |