class Laspatule::Services::Ingredients

Defined in:

laspatule/services/ingredients.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(user_id : Int32, repository : Repositories::Ingredients) #

[View source]

Instance Method Detail

def create(ingredient : Models::CreateIngredient) : Models::Ingredient #

Creates a new ingredient and returns its.


[View source]
def get_by_id(id : Int32) : Models::Ingredient #

Gets an ingredient by id.


[View source]
def search_by_name(name : String, page_size : Int32, next_page : String | Nil) : Models::Page(Models::Ingredient) #

Search ingredients by name.

See Models::Page documentation about pagination.


[View source]