Class: ParamsReady::Value::IntegerCoder

Inherits:
Coder
  • Object
show all
Defined in:
lib/params_ready/value/coder.rb

Class Method Summary collapse

Methods inherited from Coder

value_class_name

Methods included from Extensions::ClassReaderWriter

#class_reader_writer

Methods included from Coercion

#strict_default?, #try_coerce

Class Method Details

.coerce(input, _) ⇒ Object



75
76
77
78
# File 'lib/params_ready/value/coder.rb', line 75

def self.coerce(input, _)
  return nil if input.nil? || input == ''
  Integer(input)
end

.format(value, format) ⇒ Object



80
81
82
# File 'lib/params_ready/value/coder.rb', line 80

def self.format(value, format)
  value.to_s
end