slim in ruby

26 July 2006   0 comments   Linux

Mind that age!

This blog post is 16 years old! Most likely, its content is outdated. Especially if it's technical.

Just figured out how to call my slim web service via XML-RPC using Ruby. It's as easy as in Python.

Here's the code:

require "xmlrpc/client"
# Make an object to represent the XML-RPC server.
server = "", "/")
# Call the remote server and get our result
result ="slim", "h1 { font-family: Arial;}","css")
puts result
result ="slim", 
  "function add(var1, var2) { return var1 + var2; }","js")
puts result

And when you run this on the command line this is what you get:

$ ruby dummy.rb
function add(_0,_1){return _0 + _1;}


Your email will never ever be published.

Related posts