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.



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

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

Instance Attribute Details

#headersObject (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 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)

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 params
  @params
end

#urlObject (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 url
  @url
end

Instance Method Details

#==(other) ⇒ Object

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



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

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