Class: Superstore::Types::IntegerRangeType
- Inherits:
-
RangeType
- Object
- ActiveModel::Type::Value
- Base
- RangeType
- Superstore::Types::IntegerRangeType
show all
- Defined in:
- lib/superstore/types/integer_range_type.rb
Instance Method Summary
collapse
Methods inherited from RangeType
#cast_value, #deserialize, #serialize
Methods inherited from Base
#type
Instance Method Details
#convert_min(method, value) ⇒ Object
10
11
12
|
# File 'lib/superstore/types/integer_range_type.rb', line 10
def convert_min(method, value)
value.nil? ? -Float::INFINITY : super
end
|
#serialize_for_open_ended(value) ⇒ Object
6
7
8
|
# File 'lib/superstore/types/integer_range_type.rb', line 6
def serialize_for_open_ended(value)
value&.abs == Float::INFINITY ? nil : super
end
|