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



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

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.



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

def headers
  @headers
end

#http_verbObject (readonly)

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



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

def http_verb
  @http_verb
end

#paramsObject (readonly)

Returns the value of attribute params.



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

def params
  @params
end

#urlObject (readonly)

Returns the value of attribute url.



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

def url
  @url
end

Instance Method Details

#==(event) ⇒ Object

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



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

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