27 Oct '14, 10am

つか / 他9コメント “Grape - RailsでスピーディにAPIを作成! - 酒と泪とRubyとRailsと”

module Twitter class API < Grape :: API # versionは:headerや、:paramなどもあり version 'v1' , using : :path , vendor : 'twitter' format :json helpers do def current_user @current_user ||= User . authorize! ( env ) end def authenticate! error! ( '401 Unauthorized' , 401 ) unless current_user end end resource :statuses do desc "Return a public timeline." get :public_timeline do Status . limit ( 20 ) end desc "Return a personal timeline." get :home_timeline do authenticate! current_user . statuses . limit ( 20 ) end desc "Return a status." params do requires :id , type : Integer , desc : "Status id." end route_param :id do get do Status . find ( params [ :id ] ) end end desc "Create a status." params do requires :status , type : String , desc : "Your status." end post do authenticate! Status . create! ({ user : current_user , text : params [ :status ] }) end desc "Update a status." p...

Full article: http://morizyun.github.io/blog/rails-grepe-api-heroku-ruby/

Tweets

つか / 他9コメント “Grape - RailsでスピーディにAPIを作成! - 酒と泪と...

b.hatena.ne.jp 27 Oct '14, 10am

Grape - RailsでスピーディにAPIを作成! - 酒と泪とRubyとRailsと テクノロジー 2013/12/14 10:17 酒と泪とRubyとRailsと rails API grape ruby ライブラリ sinatra *...

NIKE AIR MAX 1 (HYPER GRAPE)

NIKE AIR MAX 1 (HYPER GRAPE)

sneakerfreaker.com 28 Oct '14, 7am

Who doesn’t love some grape on their Air Max 1s ? This colourway is awesomely simple; black and grey on a white midsole, w...