Contracts.ruby

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class UsersController < ApplicationController
  UserParams = ({:id => SNum, :user => {:first => String, :last => String, :email => Email} })
 
  def update
    user = User.find(params[:id])
    user.update_attributes(user_params(params))
    redirect_to home_path
  end
 
  private
 
  Contract UserParams => Any
  def user_params(params)
    params
  end
end