Class: Brut::FrontEnd::Handlers::InstrumentationHandler::Event

Inherits:
Data
  • Object
show all
Defined in:
lib/brut/front_end/handlers/instrumentation_handler.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes

Returns:

  • (Object)

    the current value of attributes



3
4
5
# File 'lib/brut/front_end/handlers/instrumentation_handler.rb', line 3

def attributes
  @attributes
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



3
4
5
# File 'lib/brut/front_end/handlers/instrumentation_handler.rb', line 3

def name
  @name
end

#timestampObject (readonly)

Returns the value of attribute timestamp

Returns:

  • (Object)

    the current value of timestamp



3
4
5
# File 'lib/brut/front_end/handlers/instrumentation_handler.rb', line 3

def timestamp
  @timestamp
end

Class Method Details

.from_json(json) ⇒ Object



4
5
6
7
8
9
# File 'lib/brut/front_end/handlers/instrumentation_handler.rb', line 4

def self.from_json(json)
  name       = json["name"]
  timestamp  = Time.at(json["timestamp"].to_i / 1000.0)
  attributes = json["attributes"] || {}
  self.new(name:,timestamp:,attributes:)
end