Class: ActiveSupportTypeExtensions::Array
- Inherits:
-
ActiveModel::Type::Value
- Object
- ActiveModel::Type::Value
- ActiveSupportTypeExtensions::Array
- Defined in:
- lib/active_support_type_extensions/array.rb
Instance Method Summary collapse
Instance Method Details
#cast_value(value) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/active_support_type_extensions/array.rb', line 9 def cast_value(value) case value when String cast_value(value.split(/,(?!.*\|)|\|(?!.*,)/)) when ::Array value.map { |item| Integer(item, exception: false) || item } else ::Array.wrap(value) end end |
#serializable?(_) ⇒ Boolean
5 6 7 |
# File 'lib/active_support_type_extensions/array.rb', line 5 def serializable?(_) false end |