blob: edd51eed30b8ac903b61f2b6fa4e50ac9d09744f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
require 'json'
require_relative 'access_status'
class GitAccessStatus < AccessStatus
attr_reader :gl_repository, :gl_username, :repository_path, :gitaly
def initialize(status, message, gl_repository: nil, gl_username: nil, repository_path: nil, gitaly: nil)
@status = status
@message = message
@gl_repository = gl_repository
@gl_username = gl_username
@repository_path = repository_path
@gitaly = gitaly
end
def self.create_from_json(json)
values = JSON.parse(json)
new(values["status"],
values["message"],
gl_repository: values["gl_repository"],
gl_username: values["gl_username"],
repository_path: values["repository_path"],
gitaly: values["gitaly"])
end
end
|