Class: Solvent

Inherits:
Object
  • Object
show all
Defined in:
lib/solvent.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#statusObject

Returns the value of attribute status.



7
8
9
# File 'lib/solvent.rb', line 7

def status
  @status
end

#urlObject

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

#expireObject



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