Class: Guillotine::StringHostChecker
- Inherits:
-
HostChecker
- Object
- HostChecker
- Guillotine::StringHostChecker
- Defined in:
- lib/guillotine/host_checkers.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
Attributes inherited from HostChecker
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(host) ⇒ StringHostChecker
constructor
A new instance of StringHostChecker.
- #valid?(url) ⇒ Boolean
Methods inherited from HostChecker
Constructor Details
#initialize(host) ⇒ StringHostChecker
Returns a new instance of StringHostChecker.
54 55 56 57 58 |
# File 'lib/guillotine/host_checkers.rb', line 54 def initialize(host) @error = "URL must be from #{host}" @host = host super end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
52 53 54 |
# File 'lib/guillotine/host_checkers.rb', line 52 def host @host end |
Class Method Details
.match?(arg) ⇒ Boolean
48 49 50 |
# File 'lib/guillotine/host_checkers.rb', line 48 def self.match?(arg) arg.is_a?(String) end |
Instance Method Details
#valid?(url) ⇒ Boolean
60 61 62 |
# File 'lib/guillotine/host_checkers.rb', line 60 def valid?(url) url.host == @host end |