Skip to content

Instantly share code, notes, and snippets.

@SleeplessByte
Created July 27, 2015 13:20
Show Gist options
  • Save SleeplessByte/a7492a580a2f9b7830dd to your computer and use it in GitHub Desktop.
Save SleeplessByte/a7492a580a2f9b7830dd to your computer and use it in GitHub Desktop.
Camelize Grape Entity output
class XmlEntity < Grape::Entity
protected
def self.key_for( attribute )
( exposures[ attribute.to_sym ][ :as ] || name_for( attribute ) ).to_s.camelize
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment