Class: Arspy::Operators::AttributeTest::StringTest
- Inherits:
-
Base
- Object
- Base
- Arspy::Operators::AttributeTest::StringTest
show all
- Defined in:
- lib/arspy/operators/attribute_test/string_test.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Class Method Details
.applies?(param) ⇒ Boolean
7
8
9
|
# File 'lib/arspy/operators/attribute_test/string_test.rb', line 7
def self.applies?(param)
param.is_a? String
end
|
Instance Method Details
#match?(value_or_object) ⇒ Boolean
11
12
13
14
15
16
17
18
|
# File 'lib/arspy/operators/attribute_test/string_test.rb', line 11
def match?(value_or_object)
case value_or_object
when ActiveRecord::Base
value_or_object.instance_eval{ value_or_object }
else
value_or_object.to_s == @param rescue nil
end
end
|