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.
trustieforge/app/api/mobile/entities/attachment.rb

23 lines
558 B

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 :filename
attachment_expose :description
end
end
end