Created
November 11, 2015 09:32
-
-
Save milushov/d44cf605501ab5452c36 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
require 'sinatra' | |
require 'json' | |
require 'faker' | |
POSITION = %w( | |
Новичок | |
Даритель | |
Наставник | |
Меценат | |
) | |
def people(count) | |
count.times.map do |id| | |
{ | |
id: id+1, | |
name: Faker::Name.name, | |
position: POSITION[rand(0..3)], | |
tems_count: rand(10..100), | |
tickets_count: rand(100..5000), | |
} | |
end | |
end | |
get '/team.json' do | |
content_type :json | |
count = params[:count] ? params[:count].to_i : 100 | |
people(count).to_json | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Focused dashboard,!Fine-grained permissions..?Repositoryne..!