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 :type course_dynamic_expose :count course_dynamic_expose :course_name course_dynamic_expose :course_id course_dynamic_expose :course_img_url end end end