Class: Optimizely::SnapshotEvent
- Inherits:
-
Object
- Object
- Optimizely::SnapshotEvent
- Defined in:
- lib/optimizely/event/entity/snapshot_event.rb
Instance Attribute Summary collapse
-
#entity_id ⇒ Object
readonly
Returns the value of attribute entity_id.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#revenue ⇒ Object
readonly
Returns the value of attribute revenue.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(entity_id:, uuid:, key:, timestamp:, revenue: nil, value: nil, tags: nil) ⇒ SnapshotEvent
constructor
A new instance of SnapshotEvent.
Constructor Details
#initialize(entity_id:, uuid:, key:, timestamp:, revenue: nil, value: nil, tags: nil) ⇒ SnapshotEvent
Returns a new instance of SnapshotEvent.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/optimizely/event/entity/snapshot_event.rb', line 22 def initialize( entity_id:, uuid:, key:, timestamp:, revenue: nil, value: nil, tags: nil ) @entity_id = entity_id @uuid = uuid @key = key @timestamp = @revenue = revenue @value = value @tags = end |
Instance Attribute Details
#entity_id ⇒ Object (readonly)
Returns the value of attribute entity_id.
20 21 22 |
# File 'lib/optimizely/event/entity/snapshot_event.rb', line 20 def entity_id @entity_id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
20 21 22 |
# File 'lib/optimizely/event/entity/snapshot_event.rb', line 20 def key @key end |
#revenue ⇒ Object (readonly)
Returns the value of attribute revenue.
20 21 22 |
# File 'lib/optimizely/event/entity/snapshot_event.rb', line 20 def revenue @revenue end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
20 21 22 |
# File 'lib/optimizely/event/entity/snapshot_event.rb', line 20 def @tags end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
20 21 22 |
# File 'lib/optimizely/event/entity/snapshot_event.rb', line 20 def @timestamp end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
20 21 22 |
# File 'lib/optimizely/event/entity/snapshot_event.rb', line 20 def uuid @uuid end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
20 21 22 |
# File 'lib/optimizely/event/entity/snapshot_event.rb', line 20 def value @value end |
Instance Method Details
#as_json ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/optimizely/event/entity/snapshot_event.rb', line 40 def as_json hash = {entity_id: @entity_id, uuid: @uuid, key: @key, timestamp: @timestamp} hash[:revenue] = @revenue unless @revenue.nil? hash[:value] = @value unless @value.nil? hash[:tags] = @tags unless @tags.nil? hash end |