Class: Aws::Query::Param

Inherits:
Object
  • Object
show all
Defined in:
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)



9
10
11
12
# File 'lib/aws-sdk-core/query/param.rb', line 9

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

Instance Attribute Details

#nameString (readonly)

Returns:

  • (String)


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

def name
  @name
end

#valueString? (readonly)

Returns:

  • (String, nil)


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

def value
  @value
end

Instance Method Details

#<=>(other) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



33
34
35
# File 'lib/aws-sdk-core/query/param.rb', line 33

def <=> other
  name <=> other.name
end

#==(other) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



26
27
28
29
30
# File 'lib/aws-sdk-core/query/param.rb', line 26

def ==(other)
  other.kind_of?(Param) &&
  other.name == name &&
  other.value == value
end

#to_sString

Returns:

  • (String)


21
22
23
# File 'lib/aws-sdk-core/query/param.rb', line 21

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