struct

FruitJokes::ComedianRepository

Inherits Struct < Value < Object

Constructors

new(db : DB::Database)
Source

Instance methods

count_current_month

Get the count of comedians created in the current month

Source
count_previous_month

Get the count of comedians created in the previous month

Source
create(name : String, specialty : String) : Int64

Create a new comedian

Source
delete(id : Int64) : Nil

Delete a comedian

Source
find(id : Int64) : SingleComedianRow | Nil

Find a comedian by ID

Source
latest(limit : Int32 = 10) : Array(ComedianRow)

Get the most recent comedians with their joke counts

Source
list(page : Int32 = 1, per_page : Int32 = 10) : Tuple(Array(ComedianRow), PaginationData)

Get a paginated list of comedians

Source
list_by_specialty(specialty : String, page : Int32 = 1, per_page : Int32 = 10) : Tuple(Array(ComedianRow), PaginationData)

Get a paginated list of comedians filtered by specialty

Source
month_over_month_delta

Get the delta between current month and previous month

Source
total_count

Get the total count of comedians

Source
total_count_by_specialty(specialty : String) : Int64

Get the total count of comedians filtered by specialty

Source
unique_specialties

Get all unique specialties from comedians

Source
update(id : Int64, name : String, specialty : String) : Nil

Update an existing comedian

Source

Nested types