switch Resource to metaprogrammed attributes to adapt to API

following the approach from the Python and PHP libraries, I switched the Ruby one to meta_program the Resource attributes. 
This should make it more resilient to API changes.

poke @hmarr