Class: WebIdeTerminal

Inherits:
Object
  • Object
show all
Includes:
Gitlab::Routing
Defined in:
app/models/web_ide_terminal.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Gitlab::Routing

includes_helpers, redirect_legacy_paths, url_helpers

Constructor Details

#initialize(build) ⇒ WebIdeTerminal

Returns a new instance of WebIdeTerminal.



10
11
12
13
# File 'app/models/web_ide_terminal.rb', line 10

def initialize(build)
  @build = build
  @project = build.project
end

Instance Attribute Details

#buildObject (readonly)

Returns the value of attribute build.



6
7
8
# File 'app/models/web_ide_terminal.rb', line 6

def build
  @build
end

#projectObject (readonly)

Returns the value of attribute project.



6
7
8
# File 'app/models/web_ide_terminal.rb', line 6

def project
  @project
end

Instance Method Details

#cancel_pathObject



23
24
25
# File 'app/models/web_ide_terminal.rb', line 23

def cancel_path
  web_ide_terminal_route_generator(:cancel)
end

#proxy_websocket_pathObject



31
32
33
# File 'app/models/web_ide_terminal.rb', line 31

def proxy_websocket_path
  proxy_project_job_path(project, build, format: :ws)
end

#retry_pathObject



19
20
21
# File 'app/models/web_ide_terminal.rb', line 19

def retry_path
  web_ide_terminal_route_generator(:retry)
end

#servicesObject



35
36
37
# File 'app/models/web_ide_terminal.rb', line 35

def services
  build.services.map(&:alias).compact + Array(build.image&.alias)
end

#show_pathObject



15
16
17
# File 'app/models/web_ide_terminal.rb', line 15

def show_path
  web_ide_terminal_route_generator(:show)
end

#terminal_pathObject



27
28
29
# File 'app/models/web_ide_terminal.rb', line 27

def terminal_path
  terminal_project_job_path(project, build, format: :ws)
end