class EdemRedirect::Builders::Url

Public Class Methods

new(**args) click to toggle source
# File lib/edem_redirect/builders/url.rb, line 8
def initialize(**args)
  @path = args[:path]
  @host = args[:host]
  @uid = args[:user_uid]
end

Public Instance Methods

call() click to toggle source
# File lib/edem_redirect/builders/url.rb, line 14
def call
  url = URI(ENV['ROUTER_REDIRECT_PATH'])
  url.query = URI.encode_www_form encode_params
  url.to_s
end

Private Instance Methods

encode_params() click to toggle source
# File lib/edem_redirect/builders/url.rb, line 22
def encode_params
  {
    token: JWT.encode(request_params, nil, 'none')
  }
end
request_params() click to toggle source
# File lib/edem_redirect/builders/url.rb, line 28
def request_params
  {
    path: @path,
    host: @host,
    user_uid: @uid
  }
end