parent
b6207c0a47
commit
a4d7e5f932
@ -0,0 +1,23 @@
|
||||
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
|
Loading…
Reference in new issue