Class: Gitlab::Lfs::Router

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/lfs/router.rb

Instance Method Summary collapse

Constructor Details

#initialize(project, user, request) ⇒ Router

Returns a new instance of Router


4
5
6
7
8
9
# File 'lib/gitlab/lfs/router.rb', line 4

def initialize(project, user, request)
  @project = project
  @user = user
  @env = request.env
  @request = request
end

Instance Method Details

#try_callObject


11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/gitlab/lfs/router.rb', line 11

def try_call
  return unless @request && @request.path.present?

  case @request.request_method
  when 'GET'
    get_response
  when 'POST'
    post_response
  when 'PUT'
    put_response
  else
    nil
  end
end