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
81 82 83 84 85 86 87 88 89 90 |
# File 'lib/random_methods.rb', line 81 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
50 51 52 53 54 55 |
# File 'lib/random_methods.rb', line 50 def half strL = self.length strH = strL / 2 newString = self[0..strH] return newString end |
#index_domain ⇒ Object
made for link class
72 73 74 75 76 77 78 79 |
# File 'lib/random_methods.rb', line 72 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
57 58 59 60 61 62 |
# File 'lib/random_methods.rb', line 57 def quarter strL = self.length strH = strL / 4 newString = self[0..strH] return newString end |
#three_quarters ⇒ Object
64 65 66 67 68 69 |
# File 'lib/random_methods.rb', line 64 def three_quarters strL = self.length strH = strL - (strL / 4) newString = self[0..strH] return newString end |