Class: Optimizely::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/optimizely/event_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_verb, url, params, headers) ⇒ Event

Returns a new instance of Event.



31
32
33
34
35
36
# File 'lib/optimizely/event_builder.rb', line 31

def initialize(http_verb, url, params, headers)
  @http_verb = http_verb
  @url = url
  @params = params
  @headers = headers
end

Instance Attribute Details

#headersObject (readonly)

Returns the value of attribute headers.



29
30
31
# File 'lib/optimizely/event_builder.rb', line 29

def headers
  @headers
end

#http_verbObject (readonly)

Representation of an event which can be sent to the Optimizely logging endpoint.



26
27
28
# File 'lib/optimizely/event_builder.rb', line 26

def http_verb
  @http_verb
end

#paramsObject (readonly)

Returns the value of attribute params.



27
28
29
# File 'lib/optimizely/event_builder.rb', line 27

def params
  @params
end

#urlObject (readonly)

Returns the value of attribute url.



28
29
30
# File 'lib/optimizely/event_builder.rb', line 28

def url
  @url
end

Instance Method Details

#==(event) ⇒ Object

Override equality operator to make two events with the same contents equal for testing purposes



39
40
41
# File 'lib/optimizely/event_builder.rb', line 39

def ==(event)
  @http_verb == event.http_verb && @url == event.url && @params == event.params && @headers == event.headers
end