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.



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

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.



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

def headers
  @headers
end

#http_verbObject (readonly)

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



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

def http_verb
  @http_verb
end

#paramsObject (readonly)

Returns the value of attribute params.



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

def params
  @params
end

#urlObject (readonly)

Returns the value of attribute url.



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

def url
  @url
end

Instance Method Details

#==(other) ⇒ Object

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



43
44
45
# File 'lib/optimizely/event_builder.rb', line 43

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