Class: PeepingTom::Site

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, url, opts = {}) ⇒ Site

Returns a new instance of Site.



5
6
7
8
9
# File 'lib/peeping_tom/site.rb', line 5

def initialize(name, url, opts = {})
  @name = name
  @url = url
  @timeout = opts[:timeout] || 10
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/peeping_tom/site.rb', line 3

def name
  @name
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



3
4
5
# File 'lib/peeping_tom/site.rb', line 3

def timeout
  @timeout
end

Instance Method Details

#urlObject



11
12
13
14
15
# File 'lib/peeping_tom/site.rb', line 11

def url
  @url = @url + "/" unless @url =~ /\//
  @url = "http://#{@url}" unless @url =~ /^http:\/\//
  @url
end