#!/usr/bin/ruby

require 'sinatra/base'
require './vem'
require './hitachicontrol'
require './feicontrol'
require './jeolcontrol'


class Vemapi < Sinatra::Base

    get '/' do
        'VEM API test'
    end

    get '/:emname/:parameter' do
        @@vem = VEM.create("#{params[:emname]}");
        result = @@vem.__send__("#{params[:parameter]}")
        "#{result}"
    end

end

 Vemapi.run! :host => 'localhost', :port => 9090
