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.121.1 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.121.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.120.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.119.1 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.119.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.118.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.117.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.116.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.115.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.114.3 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.114.2 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.114.1 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.114.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.113.1 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.113.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.112.1 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.112.0 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.111.2 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.111.1 lib/aws-sdk-core/query/param.rb
aws-sdk-core-3.111.0 lib/aws-sdk-core/query/param.rb