class Avromatic::Model::Types::FloatType
Constants
- INPUT_CLASSES
- VALUE_CLASSES
Public Instance Methods
Source
# File lib/avromatic/model/types/float_type.rb, line 24 def coerce(input) if input.nil? || input.is_a?(::Float) input elsif input.is_a?(::Integer) input.to_f else raise ArgumentError.new("Could not coerce '#{input.inspect}' to #{name}") end end
Source
# File lib/avromatic/model/types/float_type.rb, line 16 def input_classes INPUT_CLASSES end
Source
# File lib/avromatic/model/types/float_type.rb, line 38 def referenced_model_classes EMPTY_ARRAY end
Source
# File lib/avromatic/model/types/float_type.rb, line 34 def serialize(value, _strict) value end
Source
# File lib/avromatic/model/types/float_type.rb, line 12 def value_classes VALUE_CLASSES end