Class: Aws::Query::ParamList Private

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/aws-sdk-core/query/param_list.rb

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

Defined Under Namespace

Classes: IoWrapper

Instance Method Summary collapse

Constructor Details

#initializeParamList

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.

Returns a new instance of ParamList.


12
13
14
# File 'lib/aws-sdk-core/query/param_list.rb', line 12

def initialize
  @params = {}
end

Instance Method Details

#[](param_name) ⇒ Param?

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.

Returns:


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

def [](param_name)
  @params[param_name.to_s]
end

#delete(param_name) ⇒ Param?

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.

Parameters:

  • param_name (String)

Returns:


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

def delete(param_name)
  @params.delete(param_name)
end

#each(&block) ⇒ Enumerable

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.

Returns:

  • (Enumerable)

38
39
40
# File 'lib/aws-sdk-core/query/param_list.rb', line 38

def each(&block)
  to_a.each(&block)
end

#empty?Boolean

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.

Returns:

  • (Boolean)

43
44
45
# File 'lib/aws-sdk-core/query/param_list.rb', line 43

def empty?
  @params.empty?
end

#set(param_name, param_value = nil) ⇒ Param Also known as: []=

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.

Parameters:

  • param_name (String)
  • param_value (String, nil) (defaults to: nil)

Returns:


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

def set(param_name, param_value = nil)
  param = Param.new(param_name, param_value)
  @params[param.name] = param
  param
end

#to_aArray<Param>

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.

Returns an array of sorted Aws::Query::Param objects.

Returns:


48
49
50
# File 'lib/aws-sdk-core/query/param_list.rb', line 48

def to_a
  @params.values.sort
end

#to_io#read, ...

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.

Returns:

  • (#read, #rewind, #size)

58
59
60
# File 'lib/aws-sdk-core/query/param_list.rb', line 58

def to_io
  IoWrapper.new(self)
end

#to_sString

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.

Returns:

  • (String)

53
54
55
# File 'lib/aws-sdk-core/query/param_list.rb', line 53

def to_s
  to_a.map(&:to_s).join('&')
end