Class: Hash
- Inherits:
-
Object
show all
- Defined in:
- lib/aws/s3/extensions.rb
Overview
Instance Method Summary
collapse
Instance Method Details
#to_normalized_options ⇒ Object
13
14
15
16
17
18
19
|
# File 'lib/aws/s3/extensions.rb', line 13
def to_normalized_options
inject({}) do |normalized_options, (name, value)|
normalized_options[name.] = value.to_s
normalized_options
end
end
|
#to_normalized_options! ⇒ Object
21
22
23
|
# File 'lib/aws/s3/extensions.rb', line 21
def to_normalized_options!
replace(to_normalized_options)
end
|
#to_query_string(include_question_mark = true) ⇒ Object
4
5
6
7
8
9
10
11
|
# File 'lib/aws/s3/extensions.rb', line 4
def to_query_string(include_question_mark = true)
return '' if empty?
query_string = ''
query_string << '?' if include_question_mark
query_string << inject([]) do |parameters, (key, value)|
parameters << [key, value].map {|element| element.to_s}.join('=')
end.join('&')
end
|