Class: Encuisine::Recipe
- Inherits:
-
Object
- Object
- Encuisine::Recipe
- Defined in:
- lib/encuisine/recipe.rb
Class Method Summary collapse
Class Method Details
.all ⇒ Object
6 7 8 |
# File 'lib/encuisine/recipe.rb', line 6 def all response = Connection.json.get("#{BASE_URL}/api/v1/recipes") end |
.create(json) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/encuisine/recipe.rb', line 24 def create(json) if json response = Connection.json.post("#{BASE_URL}/api/v1/recipes") do |request| request.body = json end end end |
.get(id) ⇒ Object
10 11 12 13 14 |
# File 'lib/encuisine/recipe.rb', line 10 def get(id) if id response = Connection.json.get("#{BASE_URL}/api/v1/recipes/#{id}") end end |
.search(query) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/encuisine/recipe.rb', line 16 def search(query) if query response = Connection.json.get("#{BASE_URL}/api/v1/recipes") do |request| request.params["q"] = query end end end |