camel casing of request/response data
fermion
Registered Users Posts: 13 Big grins
I've been putting a lot of time in on my Ruby Smugmug wrapper (http://github.com/fermion/smugmugr/tree/master) and I'm getting ready to commit a major update to github.
One thing that's really, really annoying is that I've got to work around the areas where the Smugmug API preserves acronyms in data keys thereby breaking camel casing. I've implemented a method_missing on all of the Ruby classes that represent Smugmug data so that things like:
and
and
all work. I've only had issues thus far with anything ending in URL:
I'd like to have match the Video1920URL key in response data, however:
I've got a workaround for now, but it's ugly. Any chance that there could be a boolean flag that would cause responses to be formatted with data keys that would conform to the above String transformations? Thanks in advance for hearing this out :-D
One thing that's really, really annoying is that I've got to work around the areas where the Smugmug API preserves acronyms in data keys thereby breaking camel casing. I've implemented a method_missing on all of the Ruby classes that represent Smugmug data so that things like:
me = Smugmugr::User.new(api_key) album = me.albums.first album.image_count
and
album.ImageCount
and
album.attributes["ImageCount"]
all work. I've only had issues thus far with anything ending in URL:
image = album.images.first image.video1920_url
I'd like to have match the Video1920URL key in response data, however:
"video1920_url".camelize => "Video1920Url"
I've got a workaround for now, but it's ugly. Any chance that there could be a boolean flag that would cause responses to be formatted with data keys that would conform to the above String transformations? Thanks in advance for hearing this out :-D
0