Created
November 27, 2011 15:46
-
-
Save DCarper/1397718 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ApiController < ApplicationController | |
| def integer_to_string | |
| render :json => { :value => params[:value] }.to_json | |
| end | |
| def concat | |
| sum = params[:a] + params[:b] | |
| render :soap => { :value => sum }.to_json | |
| end | |
| def add_circle | |
| render(:failure => "radius is too small") if params[:radius] < 3.0 | |
| x = params[:circle][:center][:x] | |
| y = params[:circle][:center][:y] | |
| radius = params[:circle][:radius] | |
| Circle.new(x, y, radius) | |
| render nil | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment