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.110.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.109.3 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.109.2 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.109.1 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.109.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.108.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.107.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.105.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.104.4 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.104.3 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.104.2 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.104.1 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.104.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.103.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.102.1 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.102.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.101.0 lib/aws-sdk-core/query/param.rb