Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/wikibot/ext/hash.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#to_openhash ⇒ Object
18 19 20 |
# File 'lib/wikibot/ext/hash.rb', line 18 def to_openhash OpenHash.new(self) end |
#to_post_fields ⇒ Object
4 5 6 7 8 9 |
# File 'lib/wikibot/ext/hash.rb', line 4 def to_post_fields inject([]) do |memo, pair| key, val = pair memo.push Curl::PostField.content(key.to_s, val.to_s) end end |
#to_querystring ⇒ Object
11 12 13 14 15 16 |
# File 'lib/wikibot/ext/hash.rb', line 11 def to_querystring inject([]) do |memo, pair| key, val = pair memo.push "#{CGI::escape(key.to_s)}=#{CGI::escape(val.to_s)}" end.join("&") end |