Class: RMD::Zing::Utils::CorrectUrl
- Inherits:
-
Object
- Object
- RMD::Zing::Utils::CorrectUrl
- Defined in:
- lib/rmd/zing/utils/correct_url.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #correct ⇒ Object
-
#initialize(url) ⇒ CorrectUrl
constructor
A new instance of CorrectUrl.
Constructor Details
#initialize(url) ⇒ CorrectUrl
Returns a new instance of CorrectUrl.
7 8 9 |
# File 'lib/rmd/zing/utils/correct_url.rb', line 7 def initialize(url) @url = url end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/rmd/zing/utils/correct_url.rb', line 5 def url @url end |
Class Method Details
.correct(url) ⇒ Object
19 20 21 |
# File 'lib/rmd/zing/utils/correct_url.rb', line 19 def self.correct(url) new(url).correct end |
Instance Method Details
#correct ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/rmd/zing/utils/correct_url.rb', line 11 def correct if redirect_location URI.escape(redirect_location) else url end end |