You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
427 B
22 lines
427 B
class CategoryPresenter
|
|
def initialize(category:, academic_year:, school:)
|
|
@category = category
|
|
@academic_year = academic_year
|
|
@school = school
|
|
end
|
|
|
|
def name
|
|
@category.name
|
|
end
|
|
|
|
def subcategories
|
|
@category.subcategories.map do |subcategory|
|
|
SubcategoryPresenter.new(
|
|
subcategory: subcategory,
|
|
academic_year: @academic_year,
|
|
school: @school,
|
|
)
|
|
end
|
|
end
|
|
end
|