Sha256: a33a97b1034027068de6e79aafac70fd1d5b441c147635179dcd4847742d4d1d

Contents?: true

Size: 697 Bytes

Versions: 26

Compression:

Stored size: 697 Bytes

Contents

# frozen_string_literal: true

module Quilt
  module Performance
    class Connection
      attr_accessor :downlink
      attr_accessor :effective_type
      attr_accessor :rtt
      attr_accessor :type

      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

      def initialize(downlink:, effective_type:, rtt:, type:)
        @downlink = downlink
        @effective_type = effective_type
        @rtt = rtt
        @type = type
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
quilt_rails-3.6.0 lib/quilt_rails/performance/connection.rb
quilt_rails-3.5.6 lib/quilt_rails/performance/connection.rb
quilt_rails-3.5.5 lib/quilt_rails/performance/connection.rb
quilt_rails-3.5.4 lib/quilt_rails/performance/connection.rb
quilt_rails-3.5.2 lib/quilt_rails/performance/connection.rb
quilt_rails-3.5.1 lib/quilt_rails/performance/connection.rb
quilt_rails-3.5.0 lib/quilt_rails/performance/connection.rb
quilt_rails-3.4.2 lib/quilt_rails/performance/connection.rb
quilt_rails-3.4.1 lib/quilt_rails/performance/connection.rb
quilt_rails-3.4.0 lib/quilt_rails/performance/connection.rb
quilt_rails-3.3.1 lib/quilt_rails/performance/connection.rb
quilt_rails-3.3.0 lib/quilt_rails/performance/connection.rb
quilt_rails-3.2.1 lib/quilt_rails/performance/connection.rb
quilt_rails-3.1.1 lib/quilt_rails/performance/connection.rb
quilt_rails-3.1.0 lib/quilt_rails/performance/connection.rb
quilt_rails-3.0.0 lib/quilt_rails/performance/connection.rb
quilt_rails-2.0.0 lib/quilt_rails/performance/connection.rb
quilt_rails-1.13.0 lib/quilt_rails/performance/connection.rb
quilt_rails-1.12.2 lib/quilt_rails/performance/connection.rb
quilt_rails-1.12.1 lib/quilt_rails/performance/connection.rb