Class: Quilt::Performance::Connection
- Inherits:
-
Object
- Object
- Quilt::Performance::Connection
- Defined in:
- lib/quilt_rails/performance/connection.rb
Instance Attribute Summary collapse
-
#downlink ⇒ Object
Returns the value of attribute downlink.
-
#effective_type ⇒ Object
Returns the value of attribute effective_type.
-
#rtt ⇒ Object
Returns the value of attribute rtt.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(downlink:, effective_type:, rtt:, type:) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(downlink:, effective_type:, rtt:, type:) ⇒ Connection
Returns a new instance of Connection.
22 23 24 25 26 27 |
# File 'lib/quilt_rails/performance/connection.rb', line 22 def initialize(downlink:, effective_type:, rtt:, type:) @downlink = downlink @effective_type = effective_type @rtt = rtt @type = type end |
Instance Attribute Details
#downlink ⇒ Object
Returns the value of attribute downlink.
6 7 8 |
# File 'lib/quilt_rails/performance/connection.rb', line 6 def downlink @downlink end |
#effective_type ⇒ Object
Returns the value of attribute effective_type.
7 8 9 |
# File 'lib/quilt_rails/performance/connection.rb', line 7 def effective_type @effective_type end |
#rtt ⇒ Object
Returns the value of attribute rtt.
8 9 10 |
# File 'lib/quilt_rails/performance/connection.rb', line 8 def rtt @rtt end |
#type ⇒ Object
Returns the value of attribute type.
9 10 11 |
# File 'lib/quilt_rails/performance/connection.rb', line 9 def type @type end |
Class Method Details
.from_params(params) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/quilt_rails/performance/connection.rb', line 11 def self.from_params(params) params.transform_keys! { |key| key.underscore.to_sym } Connection.new( downlink: params[:downlink], effective_type: params[:effective_type], rtt: params[:rtt], type: params[:type] ) end |