You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::Query::Param

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-sdk-core/lib/aws-sdk-core/query/param.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value = nil) ⇒ Param

Returns a new instance of Param

Parameters:

  • name (String)
  • value (String, nil) (defaults to: nil)

    (nil)



7
8
9
10
# File 'gems/aws-sdk-core/lib/aws-sdk-core/query/param.rb', line 7

def initialize(name, value = nil)
  @name = name.to_s
  @value = value
end

Instance Attribute Details

#nameString (readonly)

Returns:

  • (String)


13
14
15
# File 'gems/aws-sdk-core/lib/aws-sdk-core/query/param.rb', line 13

def name
  @name
end

#valueString? (readonly)

Returns:

  • (String, nil)


16
17
18
# File 'gems/aws-sdk-core/lib/aws-sdk-core/query/param.rb', line 16

def value
  @value
end

Instance Method Details

#to_sString

Returns:

  • (String)


19
20
21
# File 'gems/aws-sdk-core/lib/aws-sdk-core/query/param.rb', line 19

def to_s
  value ? "#{escape(name)}=#{escape(value)}" : "#{escape(name)}="
end