socialforge/app/api/mobile/entities/course_dynamic.rb

17 lines
493 B
Ruby

module Mobile
module Entities
class CourseDynamic < Grape::Entity
def self.course_dynamic_expose(field)
expose field do |c,opt|
c[field] if (c.is_a?(Hash) && c.key?(field))
end
end
course_dynamic_expose :course_name
course_dynamic_expose :need_anonymous_comments_count
course_dynamic_expose :student_commit_number
course_dynamic_expose :news_count
course_dynamic_expose :message_count
end
end
end