Class: PeepingTom::Site
- Inherits:
-
Object
- Object
- PeepingTom::Site
- Defined in:
- lib/peeping_tom/site.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(name, url, opts = {}) ⇒ Site
constructor
A new instance of Site.
- #url ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/peeping_tom/site.rb', line 3 def name @name end |
#timeout ⇒ Object (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
#url ⇒ Object
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 |