Class: ValidateParams::Types::IO

Inherits:
Object
  • Object
show all
Defined in:
lib/validate_params/types/i_o.rb

Class Method Summary collapse

Class Method Details

.cast(raw_value) ⇒ Object



10
11
12
13
14
# File 'lib/validate_params/types/i_o.rb', line 10

def self.cast(raw_value, **)
  return nil if raw_value.size.zero?

  raw_value
end

.valid?(value) ⇒ Boolean

Returns:



6
7
8
# File 'lib/validate_params/types/i_o.rb', line 6

def self.valid?(value)
  value.class.method_defined?(:size)
end