Class: Applicants::ScreencastOMatic::UrlBuilder

Inherits:
Object
  • Object
show all
Defined in:
app/lib/applicants/screencast_o_matic/url_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(applicant, host, port) ⇒ UrlBuilder

Returns a new instance of UrlBuilder.



8
9
10
11
12
# File 'app/lib/applicants/screencast_o_matic/url_builder.rb', line 8

def initialize applicant, host, port
  @applicant = applicant
  @host = host
  @port = port
end

Instance Attribute Details

#applicantObject (readonly)

Returns the value of attribute applicant.



6
7
8
# File 'app/lib/applicants/screencast_o_matic/url_builder.rb', line 6

def applicant
  @applicant
end

#hostObject (readonly)

Returns the value of attribute host.



6
7
8
# File 'app/lib/applicants/screencast_o_matic/url_builder.rb', line 6

def host
  @host
end

Instance Method Details

#callback_urlObject



28
29
30
# File 'app/lib/applicants/screencast_o_matic/url_builder.rb', line 28

def callback_url
  screen_recorder_callbacks_applicant_url(applicant, url_params)
end

#descriptor_file_urlObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/lib/applicants/screencast_o_matic/url_builder.rb', line 14

def descriptor_file_url
  uri = URI::HTTPS.build({
                          host: host,
                          path: "/screen_recorder/applicants/#{applicant.id}/file/#{applicant.video_handle}",
                          query: {
                            upload_callback_url: upload_callback_url,
                            thank_you_page_url: thank_you_page_url,
                            screen_recorder_callback_url: callback_url
                          }.to_query,
                        })
  uri.scheme = "usertesting"
  uri.to_s
end

#thank_you_page_urlObject



32
33
34
# File 'app/lib/applicants/screencast_o_matic/url_builder.rb', line 32

def thank_you_page_url
  next_steps_applicant_url(applicant, url_params)
end

#upload_callback_urlObject



36
37
38
# File 'app/lib/applicants/screencast_o_matic/url_builder.rb', line 36

def upload_callback_url
  video_server_callback_applicant_url(applicant, url_params)
end