Class: Zutat::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/zutat/client.rb

Constant Summary collapse

URL =
"https://diy.soylent.me/recipes/"

Instance Method Summary collapse

Instance Method Details

#get_recipe(id) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/zutat/client.rb', line 5

def get_recipe(id)
  raise "invalid recipe id." unless id.is_a? String

  @url = URI((URL + id + "/json"))
  @res = Net::HTTP.get(@url)

  return Zutat::Recipe.new(@res)
end