Class: Twingly::URL::NullURL
- Inherits:
-
Object
- Object
- Twingly::URL::NullURL
show all
- Includes:
- Comparable
- Defined in:
- lib/twingly/url/null_url.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object
6
7
8
9
10
11
|
# File 'lib/twingly/url/null_url.rb', line 6
def method_missing(name, *)
error = NoMethodError.new("undefined method `#{name}'")
raise error unless Twingly::URL.instance_methods.include?(name)
""
end
|
Instance Method Details
#<=>(other) ⇒ Object
21
22
23
|
# File 'lib/twingly/url/null_url.rb', line 21
def <=>(other)
self.to_s <=> other.to_s
end
|
#normalized ⇒ Object
13
14
15
|
# File 'lib/twingly/url/null_url.rb', line 13
def normalized
self
end
|
#to_s ⇒ Object
25
26
27
|
# File 'lib/twingly/url/null_url.rb', line 25
def to_s
""
end
|
#valid? ⇒ Boolean
17
18
19
|
# File 'lib/twingly/url/null_url.rb', line 17
def valid?
false
end
|