Sha256: 9bbd560686a2beff9b8f193f2aa4dae22777b25a5e4e35e21072de7fb6c52fc3

Contents?: true

Size: 802 Bytes

Versions: 197

Compression:

Stored size: 802 Bytes

Contents

# frozen_string_literal: true

module Aws
  module Query
    class Param

      # @param [String] name
      # @param [String, nil] value (nil)
      def initialize(name, value = nil)
        @name = name.to_s
        @value = value
      end

      # @return [String]
      attr_reader :name

      # @return [String, nil]
      attr_reader :value

      # @return [String]
      def to_s
        value ? "#{escape(name)}=#{escape(value)}" : "#{escape(name)}="
      end

      # @api private
      def ==(other)
        other.kind_of?(Param) &&
        other.name == name &&
        other.value == value
      end

      # @api private
      def <=> other
        name <=> other.name
      end

      private

      def escape(str)
        Seahorse::Util.uri_escape(str)
      end

    end
  end
end

Version data entries

197 entries across 197 versions & 1 rubygems

Version Path
aws-sdk-core-3.138.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.137.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.136.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.135.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.134.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.133.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.132.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.131.6 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.131.5 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.131.4 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.131.3 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.131.2 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.131.1 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.131.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.130.2 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.130.1 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.130.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.129.1 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.129.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.128.1 lib/aws-sdk-core/query/param.rb