Class: AccessGrid::Event
- Inherits:
-
Object
- Object
- AccessGrid::Event
- Defined in:
- lib/accessgrid/console.rb
Instance Attribute Summary collapse
-
#ip_address ⇒ Object
readonly
Returns the value of attribute ip_address.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#user_agent ⇒ Object
readonly
Returns the value of attribute user_agent.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Instance Method Summary collapse
-
#initialize(data) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(data) ⇒ Event
Returns a new instance of Event.
87 88 89 90 91 92 93 94 |
# File 'lib/accessgrid/console.rb', line 87 def initialize(data) @type = data['event'] @timestamp = data['created_at'] @user_id = data['metadata']['user_id'] if data['metadata'] && data['metadata']['user_id'] @ip_address = data['ip_address'] @user_agent = data['user_agent'] @metadata = data['metadata'] end |
Instance Attribute Details
#ip_address ⇒ Object (readonly)
Returns the value of attribute ip_address.
85 86 87 |
# File 'lib/accessgrid/console.rb', line 85 def ip_address @ip_address end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
85 86 87 |
# File 'lib/accessgrid/console.rb', line 85 def @metadata end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
85 86 87 |
# File 'lib/accessgrid/console.rb', line 85 def @timestamp end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
85 86 87 |
# File 'lib/accessgrid/console.rb', line 85 def type @type end |
#user_agent ⇒ Object (readonly)
Returns the value of attribute user_agent.
85 86 87 |
# File 'lib/accessgrid/console.rb', line 85 def user_agent @user_agent end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
85 86 87 |
# File 'lib/accessgrid/console.rb', line 85 def user_id @user_id end |