module Mobile module Entities class Attachment < Grape::Entity def self.attachment_expose(field) expose field do |f,opt| if f.is_a?(Hash) && f.key?(field) f[field] elsif f.is_a?(::Attachment) if f.respond_to?(field) f.send(field) else #case field # when "" #end end end end end attachment_expose :id attachment_expose :filename attachment_expose :description attachment_expose :downloads attachment_expose :quotes end end end