class Dialog::Client
Public Class Methods
new(options = {})
click to toggle source
@param options [Hash]
# File lib/dialog-api/client.rb, line 20 def initialize(options = {}) options = Dialog.options.merge(options) Configuration::VALID_OPTIONS_KEYS.each do |key| send("#{key}=", options[key]) end end
Public Instance Methods
link(url, id)
click to toggle source
Wraps an url into a trackable Dialog
url @param url [String] An URL to redirect the user to @param id [String] An interlocutor distinct Id provided by the platform or the provider @return [String]
# File lib/dialog-api/client.rb, line 31 def link(url, id) escaped = URI.escape(url, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")) URI.join(api_endpoint, "v1/b/", bot_id, "/click/", "?id=#{id}&url=#{escaped}").to_s end