Class: Zutat::Client
- Inherits:
-
Object
- Object
- Zutat::Client
- 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 13 14 |
# File 'lib/zutat/client.rb', line 5 def get_recipe(id) if not id.is_a? String raise "invalid recipe id." end @url = URI((URL + id + "/json")) @res = Net::HTTP.get(@url) return Zutat::Recipe.new(@res) end |