Web service interface


#1

I’m trying to create an application that interfaces with the metaweblog
API of a remote blog.

I’ve installed a nifty little ruby module called “blog/client” and have
it working if I put all the code into my controller.

Now, I wanted to try and put the code into a model so that I can create
a new connection to the blog using @blog = Blog.new(id) and then save
posts back to the blog using @blog.save(post).

Obviously as this doesn’t have an associated database table it shouldn’t
inherit from activerecord::base (is this a correct assumption?). I’ve
tried creating a model like this but Rails just complains back to be

“undefined method `new’ for Blog:Module”

Even though I have specified a new and initialize method within the
blog.rb model.

Am I going about this the right way? Should I just leave the code in the
controller?