Class: LittleBlueFox::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/littlebluefox/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_type, uref, email, remote_ip, http_headers) ⇒ Event

Returns a new instance of Event.



11
12
13
# File 'lib/littlebluefox/event.rb', line 11

def initialize(event_type, uref, email, remote_ip, http_headers)
  @event_type, @uref, @email, @remote_ip, @http_headers = event_type, uref, email, remote_ip, http_headers
end

Instance Attribute Details

#emailObject

Returns the value of attribute email.



5
6
7
# File 'lib/littlebluefox/event.rb', line 5

def email
  @email
end

#event_typeObject

Returns the value of attribute event_type.



5
6
7
# File 'lib/littlebluefox/event.rb', line 5

def event_type
  @event_type
end

#http_headersObject

Returns the value of attribute http_headers.



5
6
7
# File 'lib/littlebluefox/event.rb', line 5

def http_headers
  @http_headers
end

#remote_ipObject

Returns the value of attribute remote_ip.



5
6
7
# File 'lib/littlebluefox/event.rb', line 5

def remote_ip
  @remote_ip
end

#urefObject

Returns the value of attribute uref.



5
6
7
# File 'lib/littlebluefox/event.rb', line 5

def uref
  @uref
end

Instance Method Details

#to_jsonObject



15
16
17
18
19
20
21
22
23
# File 'lib/littlebluefox/event.rb', line 15

def to_json
  JSON.dump({
    event_type: event_type,
    uref: uref,
    email: email,
    remote_ip: remote_ip,
    http_headers: normalized_http_headers,
  })
end