Class: Net::HTTPResponse
- Inherits:
-
Object
- Object
- Net::HTTPResponse
- Includes:
- Enumerable
- Defined in:
- lib/iplayer/browser.rb
Overview
Monkey-patch in some 21st-century functionality
Instance Method Summary collapse
Instance Method Details
#cookies ⇒ Object
7 8 9 10 11 |
# File 'lib/iplayer/browser.rb', line 7 def inject([]){ |acc, (key, value)| key == 'set-cookie' ? acc << value.split(/;/).first : acc } end |
#to_hash ⇒ Object
13 14 15 16 17 18 |
# File 'lib/iplayer/browser.rb', line 13 def to_hash @to_hash ||= inject({}){ |hash, (key, value)| hash[key] = value hash } end |