Class: Hash
Overview
:stopdoc:
Direct Known Subclasses
Aliyun::OSS::Base::RequestOptions, Aliyun::OSS::Connection::Options, Aliyun::OSS::OSSObject::About, Aliyun::OSS::OSSObject::Metadata, Aliyun::OSS::Parsing::XmlParser
Instance Method Summary collapse
-
#extractable_options? ⇒ Boolean
By default, only instances of Hash itself are extractable.
- #to_normalized_options ⇒ Object
- #to_normalized_options! ⇒ Object
- #to_query_string(include_question_mark = true) ⇒ Object
Instance Method Details
#extractable_options? ⇒ Boolean
By default, only instances of Hash itself are extractable. Subclasses of Hash may implement this method and return true to declare themselves as extractable. If a Hash is extractable, Array#extract_options! pops it from the Array when it is the last element of the Array.
10 11 12 |
# File 'lib/aliyun/oss/extensions.rb', line 10 def instance_of?(Hash) end |
#to_normalized_options ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/aliyun/oss/extensions.rb', line 25 def # Convert all option names to downcased strings, and replace underscores with hyphens inject({}) do |, (name, value)| [name.to_header] = value.to_s end end |
#to_normalized_options! ⇒ Object
33 34 35 |
# File 'lib/aliyun/oss/extensions.rb', line 33 def replace() end |
#to_query_string(include_question_mark = true) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/aliyun/oss/extensions.rb', line 14 def to_query_string(include_question_mark = true) query_string = '' unless empty? query_string << '?' if include_question_mark query_string << inject([]) do |params, (key, value)| params << "#{key}=#{value}" end.join('&') end query_string end |