Class: Plog::URL
- Inherits:
-
Object
- Object
- Plog::URL
- Defined in:
- lib/url.rb
Instance Method Summary collapse
- #hashify ⇒ Object
-
#initialize(url) ⇒ URL
constructor
A new instance of URL.
- #simplify ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(url) ⇒ URL
Returns a new instance of URL.
5 6 7 8 |
# File 'lib/url.rb', line 5 def initialize(url) @url = url @obj = URI.parse URI.escape(url) end |
Instance Method Details
#hashify ⇒ Object
20 21 22 |
# File 'lib/url.rb', line 20 def hashify ::MD5.hexdigest simplify end |
#simplify ⇒ Object
14 15 16 17 18 |
# File 'lib/url.rb', line 14 def simplify simplify_url = @url.dup simplifiers.each { |k, v| simplify_url.gsub!(k, v) if k =~ simplify_url } simplify_url end |
#to_s ⇒ Object
10 11 12 |
# File 'lib/url.rb', line 10 def to_s @url end |