Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/random_methods.rb
Instance Method Summary collapse
-
#domain ⇒ Object
returns all of the url before and including the domain ending.
- #half ⇒ Object
-
#index_domain ⇒ Object
made for link class.
- #quarter ⇒ Object
- #three_quarters ⇒ Object
Instance Method Details
#domain ⇒ Object
returns all of the url before and including the domain ending
74 75 76 77 78 79 80 81 82 83 |
# File 'lib/random_methods.rb', line 74 def domain # returns all of the url before and including the domain ending domainIndex = self.index(@@Domains) if domainIndex == nil then return nil else domainEnd = domainIndex + 2 domainName = self[0..domainEnd] return domainName end end |
#half ⇒ Object
43 44 45 46 47 48 |
# File 'lib/random_methods.rb', line 43 def half strL = self.length strH = strL / 2 newString = self[0..strH] return newString end |
#index_domain ⇒ Object
made for link class
65 66 67 68 69 70 71 72 |
# File 'lib/random_methods.rb', line 65 def index_domain # gives index of the domain ending domainIndex = self.index(@@Domains) if domainIndex == nil then return nil else return domainIndex end end |
#quarter ⇒ Object
50 51 52 53 54 55 |
# File 'lib/random_methods.rb', line 50 def quarter strL = self.length strH = strL / 4 newString = self[0..strH] return newString end |
#three_quarters ⇒ Object
57 58 59 60 61 62 |
# File 'lib/random_methods.rb', line 57 def three_quarters strL = self.length strH = strL - (strL / 4) newString = self[0..strH] return newString end |