Class: RokuBuilder::Linker

Inherits:
Util
  • Object
show all
Defined in:
lib/roku_builder/linker.rb

Overview

Launch application, sending parameters

Instance Method Summary collapse

Methods inherited from Util

#init, #initialize, #multipart_connection, options_parse, #simple_connection

Constructor Details

This class inherits a constructor from RokuBuilder::Util

Instance Method Details

Note:

Options string should be formated like the following: “<key>:<value>[, <key>:<value>]*”

Note:

Any options will be accepted and sent to the app

Deeplink to the currently sideloaded app

Parameters:

  • options (String)

    Options string



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/roku_builder/linker.rb', line 9

def link(options:)
  path = "/launch/dev"
  return false unless options
  payload = Util.options_parse(options: options)

  unless payload.keys.count > 0
    return false
  end

  path = "#{path}?#{parameterize(payload)}"
  conn = multipart_connection(port: 8060)

  response = conn.post path
  return response.success?
end