Class: Net::HTTPOK
- Inherits:
-
Object
- Object
- Net::HTTPOK
- Defined in:
- lib/tiny_grabber/http.rb
Overview
Success response class
Instance Method Summary collapse
-
#cookies ⇒ Object
Response Cookies.
-
#headers ⇒ Object
Response Headers.
-
#ng ⇒ Object
Nokogiri object of response.
Instance Method Details
#cookies ⇒ Object
Response Cookies
15 16 17 18 19 20 |
# File 'lib/tiny_grabber/http.rb', line 15 def = get_fields('set-cookie') if .map { || .gsub(/\A([^;]+).*\Z/, '\1') }.join('&') end end |
#headers ⇒ Object
Response Headers
24 25 26 27 28 |
# File 'lib/tiny_grabber/http.rb', line 24 def headers header.to_hash.each_with_object({}) do |header_key, header_value| header_value[header_key] = header_value.first end end |
#ng ⇒ Object
Nokogiri object of response
9 10 11 |
# File 'lib/tiny_grabber/http.rb', line 9 def ng Nokogiri::HTML(body) end |