Module: Crags::Fetcher
- Included in:
- Category, Country, Search::Location
- Defined in:
- lib/crags/fetcher.rb
Instance Method Summary collapse
Instance Method Details
#fetch_doc(url) ⇒ Object
3 4 5 |
# File 'lib/crags/fetcher.rb', line 3 def fetch_doc(url) Nokogiri::XML.parse(fetch_xml(url)) end |
#fetch_request(url) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/crags/fetcher.rb', line 12 def fetch_request(url) req = Curl::Easy.new(url) req.follow_location = true req.perform req end |
#fetch_xml(url) ⇒ Object
7 8 9 10 |
# File 'lib/crags/fetcher.rb', line 7 def fetch_xml(url) req = fetch_request(url) req.body_str end |