Class: Quilt::Performance::Report
- Inherits:
-
Object
- Object
- Quilt::Performance::Report
- Defined in:
- lib/quilt_rails/performance/report.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#events ⇒ Object
Returns the value of attribute events.
-
#navigations ⇒ Object
Returns the value of attribute navigations.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(events:, navigations:, connection:) ⇒ Report
constructor
A new instance of Report.
Constructor Details
#initialize(events:, navigations:, connection:) ⇒ Report
Returns a new instance of Report.
45 46 47 48 49 |
# File 'lib/quilt_rails/performance/report.rb', line 45 def initialize(events:, navigations:, connection:) @events = events @navigations = @connection = connection end |
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
8 9 10 |
# File 'lib/quilt_rails/performance/report.rb', line 8 def connection @connection end |
#events ⇒ Object
Returns the value of attribute events.
6 7 8 |
# File 'lib/quilt_rails/performance/report.rb', line 6 def events @events end |
#navigations ⇒ Object
Returns the value of attribute navigations.
7 8 9 |
# File 'lib/quilt_rails/performance/report.rb', line 7 def @navigations end |
Class Method Details
.from_params(params) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/quilt_rails/performance/report.rb', line 11 def from_params(params) params.transform_keys! { |key| key.underscore.to_sym } params[:connection] = { effectiveType: "unknown" } if params[:connection].blank? connection = Connection.from_params(params[:connection]) Report.new( connection: connection, navigations: (params[:navigations], connection: connection), events: build_events(params[:events], connection: connection), ) end |