Class: Optimizely::Snapshot
- Inherits:
-
Object
- Object
- Optimizely::Snapshot
- Defined in:
- lib/optimizely/event/entity/snapshot.rb
Instance Attribute Summary collapse
-
#decisions ⇒ Object
readonly
Returns the value of attribute decisions.
-
#events ⇒ Object
readonly
Returns the value of attribute events.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(events:, decisions: nil) ⇒ Snapshot
constructor
A new instance of Snapshot.
Constructor Details
#initialize(events:, decisions: nil) ⇒ Snapshot
Returns a new instance of Snapshot.
22 23 24 25 |
# File 'lib/optimizely/event/entity/snapshot.rb', line 22 def initialize(events:, decisions: nil) @decisions = decisions @events = events end |
Instance Attribute Details
#decisions ⇒ Object (readonly)
Returns the value of attribute decisions.
20 21 22 |
# File 'lib/optimizely/event/entity/snapshot.rb', line 20 def decisions @decisions end |
#events ⇒ Object (readonly)
Returns the value of attribute events.
20 21 22 |
# File 'lib/optimizely/event/entity/snapshot.rb', line 20 def events @events end |
Instance Method Details
#as_json ⇒ Object
27 28 29 30 31 |
# File 'lib/optimizely/event/entity/snapshot.rb', line 27 def as_json hash = {events: @events} hash[:decisions] = @decisions unless @decisions.nil? hash end |