Class: Adaptors::IntegerAdaptor

Inherits:
Adaptor
  • Object
show all
Defined in:
lib/bureaucrat/validation_old.rb

Instance Method Summary collapse

Methods inherited from Adaptor

#initialize, #to_object

Constructor Details

This class inherits a constructor from Adaptors::Adaptor

Instance Method Details

#adapt(value) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/bureaucrat/validation_old.rb', line 40

def adapt(value)
  begin
    Integer(value)
  rescue ArgumentError
    fail_with(:not_integer)
  end
end