Module: Hexpress::Web

Included in:
Hexpress
Defined in:
lib/hexpress/web.rb

Instance Method Summary collapse

Instance Method Details

#domain(name) ⇒ Object



19
20
21
# File 'lib/hexpress/web.rb', line 19

def domain(name)
  maybe { words.with(".") }.find(name)
end

#ftpObject



27
28
29
# File 'lib/hexpress/web.rb', line 27

def ftp
  start("ftp").maybe("s").protocol
end

#ftp_onlyObject



31
32
33
# File 'lib/hexpress/web.rb', line 31

def ftp_only
  start("ftp").protocol
end

#ftps_onlyObject



35
36
37
# File 'lib/hexpress/web.rb', line 35

def ftps_only
  start("ftps").protocol
end

#httpObject



3
4
5
# File 'lib/hexpress/web.rb', line 3

def http
  start("http").maybe("s").protocol
end

#http_onlyObject



7
8
9
# File 'lib/hexpress/web.rb', line 7

def http_only
  start("http").protocol
end

#https_onlyObject



11
12
13
# File 'lib/hexpress/web.rb', line 11

def https_only
  start("https").protocol
end

#pathObject



39
40
41
# File 'lib/hexpress/web.rb', line 39

def path
  has("/").anything.maybe.maybe("?")
end

#protocolObject



15
16
17
# File 'lib/hexpress/web.rb', line 15

def protocol
  with("://")
end

#tld(name) ⇒ Object



23
24
25
# File 'lib/hexpress/web.rb', line 23

def tld(name)
  has(".").with(name).maybe("/")
end