Module: Hexpress::Web
- Included in:
- Hexpress
- Defined in:
- lib/hexpress/web.rb
Instance Method Summary collapse
- #domain(name) ⇒ Object
- #ftp ⇒ Object
- #ftp_only ⇒ Object
- #ftps_only ⇒ Object
- #http ⇒ Object
- #http_only ⇒ Object
- #https_only ⇒ Object
- #path ⇒ Object
- #protocol ⇒ Object
- #tld(name) ⇒ Object
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 |
#ftp ⇒ Object
27 28 29 |
# File 'lib/hexpress/web.rb', line 27 def ftp start("ftp").maybe("s").protocol end |
#ftp_only ⇒ Object
31 32 33 |
# File 'lib/hexpress/web.rb', line 31 def ftp_only start("ftp").protocol end |
#ftps_only ⇒ Object
35 36 37 |
# File 'lib/hexpress/web.rb', line 35 def ftps_only start("ftps").protocol end |
#http ⇒ Object
3 4 5 |
# File 'lib/hexpress/web.rb', line 3 def http start("http").maybe("s").protocol end |
#http_only ⇒ Object
7 8 9 |
# File 'lib/hexpress/web.rb', line 7 def http_only start("http").protocol end |
#https_only ⇒ Object
11 12 13 |
# File 'lib/hexpress/web.rb', line 11 def https_only start("https").protocol end |
#path ⇒ Object
39 40 41 |
# File 'lib/hexpress/web.rb', line 39 def path has("/").anything.maybe.maybe("?") end |
#protocol ⇒ Object
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 |