Sha256: a99594374e38b09f3c61736902f8fcd4b71ce8f37a8c2583cdc4b09ecf13719b

Contents?: true

Size: 771 Bytes

Versions: 1215

Compression:

Stored size: 771 Bytes

Contents

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

1,215 entries across 1,215 versions & 2 rubygems

Version Path
aws-sdk-core-2.11.572 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.571 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.570 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.569 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.568 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.567 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.566 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.565 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.564 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.563 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.562 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.561 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.560 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.559 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.558 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.557 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.556 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.555 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.554 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.553 lib/aws-sdk-core/query/param.rb