Class: Solvent
- Inherits:
-
Object
- Object
- Solvent
- Defined in:
- lib/solvent.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
Returns the value of attribute status.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #expire ⇒ Object
-
#initialize(url) ⇒ Solvent
constructor
A new instance of Solvent.
Constructor Details
#initialize(url) ⇒ Solvent
Returns a new instance of Solvent.
9 10 11 |
# File 'lib/solvent.rb', line 9 def initialize url self.url = url end |
Instance Attribute Details
#status ⇒ Object
Returns the value of attribute status.
7 8 9 |
# File 'lib/solvent.rb', line 7 def status @status end |
#url ⇒ Object
Returns the value of attribute url.
7 8 9 |
# File 'lib/solvent.rb', line 7 def url @url end |
Class Method Details
.expire(url) ⇒ Object
3 4 5 |
# File 'lib/solvent.rb', line 3 def self.expire url new(url).expire end |
Instance Method Details
#expire ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/solvent.rb', line 13 def expire e = Typhoeus::Easy.new e.url = url e.method = :purge self.status = e.perform self.status == 200 end |