Module: Nosh::ObjectExtensions
- Defined in:
- lib/nosh.rb
Instance Method Summary collapse
Instance Method Details
#nosh(url, parse = false) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/nosh.rb', line 9 def nosh(url, parse = false) if (response = ::Typhoeus::Request.get(url)).success? parse ? ::Nokogiri.parse(response.body) : response.body else puts "[#{response.code}]: \"#{response.}\"" nil end end |