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.632 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.631 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.630 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.629 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.628 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.627 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.626 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.625 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.624 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.623 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.622 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.621 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.620 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.619 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.618 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.617 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.616 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.615 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.614 lib/aws-sdk-core/query/param.rb
aws-sdk-core-2.11.613 lib/aws-sdk-core/query/param.rb