Module: BestVid::SiteKit

Defined in:
lib/bestvid/site_kit.rb

Constant Summary collapse

SITE_URL =
"https://bestvid.net"
SITE_NAME =
"BestVid"

Class Method Summary collapse

Class Method Details

.search_url(query) ⇒ Object



19
20
21
# File 'lib/bestvid/site_kit.rb', line 19

def search_url(query)
  "#{url("/search")}?q=#{URI.encode_www_form_component(query.to_s.strip)}"
end

.url(path = "") ⇒ Object



12
13
14
15
16
17
# File 'lib/bestvid/site_kit.rb', line 12

def url(path = "")
  normalized = path.to_s.strip
  return SITE_URL if normalized.empty? || normalized == "/"

  "#{SITE_URL}/#{normalized.delete_prefix("/")}"
end