Class: Inquisitive::String
- Inherits:
-
String
- Object
- String
- Inquisitive::String
show all
- Includes:
- Utils
- Defined in:
- lib/inquisitive/string.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *arguments) ⇒ Object
19
20
21
22
23
24
25
|
# File 'lib/inquisitive/string.rb', line 19
def method_missing(method_name, *arguments)
if predicate_method? method_name
(self == predication(method_name)) ^ negated
else
super
end
end
|
Instance Attribute Details
#negated ⇒ Object
Returns the value of attribute negated.
5
6
7
|
# File 'lib/inquisitive/string.rb', line 5
def negated
@negated
end
|
Instance Method Details
#===(other) ⇒ Object
10
11
12
|
# File 'lib/inquisitive/string.rb', line 10
def === other
other.class == Class and other == ::String or super
end
|
#not ⇒ Object
6
7
8
|
# File 'lib/inquisitive/string.rb', line 6
def not
self.dup.tap{ |s| s.negated = !s.negated }
end
|