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