I am using Ruby on Rails 3 and I would like to “map” JSON datas retrieved from an application (APP1) into a class of another application (APP2).
In few words the APP2 make an HTTP request to the APP1 and the APP1 send back JSON datas. The APP2 should receive this datas and create a new class populated of that datas just for its internal usage. The class in APP2 should not have a database table but is very usefull if that has all advantages of an ActiveRecord.
What I need basically is to handle the information retrieved from APP1 as
an ActiveRecord in APP2.
What do you advice? What I have to do?
You can use a lot of the nice features of ActiveRecord without ActiveRecord since most of them have been moved to ActiveModel. For example:
That said, @Wukerplank makes a good point. ActiveResource can be a really easy way to hook up 2 rails apps if you control the api.