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.



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

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:



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

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:



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

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)


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

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)


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

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:



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

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:



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

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)


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

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)


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

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