Class: AccessGrid::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/accessgrid/console.rb

Overview

Represents a template activity log event.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Event

Returns a new instance of Event.



164
165
166
167
168
169
170
171
172
# File 'lib/accessgrid/console.rb', line 164

def initialize(data)
   = data['metadata']
  @type = data['event']
  @timestamp = data['created_at']
  @user_id = ['user_id'] if  && ['user_id']
  @ip_address = data['ip_address']
  @user_agent = data['user_agent']
  @metadata = 
end

Instance Attribute Details

#ip_addressObject (readonly)

Returns the value of attribute ip_address.



162
163
164
# File 'lib/accessgrid/console.rb', line 162

def ip_address
  @ip_address
end

#metadataObject (readonly)

Returns the value of attribute metadata.



162
163
164
# File 'lib/accessgrid/console.rb', line 162

def 
  @metadata
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



162
163
164
# File 'lib/accessgrid/console.rb', line 162

def timestamp
  @timestamp
end

#typeObject (readonly)

Returns the value of attribute type.



162
163
164
# File 'lib/accessgrid/console.rb', line 162

def type
  @type
end

#user_agentObject (readonly)

Returns the value of attribute user_agent.



162
163
164
# File 'lib/accessgrid/console.rb', line 162

def user_agent
  @user_agent
end

#user_idObject (readonly)

Returns the value of attribute user_id.



162
163
164
# File 'lib/accessgrid/console.rb', line 162

def user_id
  @user_id
end