Class: Nom::Fetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/nom-ruby/fetcher.rb

Instance Method Summary collapse

Instance Method Details

#get(path, params = {}) ⇒ Object



9
10
11
12
13
# File 'lib/nom-ruby/fetcher.rb', line 9

def get(path, params = {})
  url = url_for_path(path)
  add_params(url, params)
  go(url, Net::HTTP::Get)
end

#post(path, body = {}) ⇒ Object



4
5
6
7
# File 'lib/nom-ruby/fetcher.rb', line 4

def post(path, body = {})
  url = url_for_path(path)
  go(url, Net::HTTP::Post, body)
end