Created
April 17, 2013 12:32
-
-
Save saturnflyer/5403871 to your computer and use it in GitHub Desktop.
What I want to do with representable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mapper | |
with_options :prefix => 'special_' do | |
property :id | |
property :name | |
property :other | |
end | |
end | |
# This would yield {"special_id" => 1, "special_name" => 'something', "special_other" => 'other value' } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So you still wanna access
#name
but in the document it should bespecial_name
?We were thinking about some general default configuration for representable, maybe something like
Would that help? It would be applied to all properties, though. I start liking that
with_options
block, damnit.. let me think about it.