Class: Adaptors::FloatAdaptor

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

Constant Summary

Constants included from Bureaucrat::Utils

Bureaucrat::Utils::ESCAPES

Instance Method Summary collapse

Methods included from Bureaucrat::Utils

conditional_escape, escape, flatatt, format_string, make_bool, make_float, mark_safe, pretty_name, security_hash

Methods inherited from Adaptor

#initialize, #to_object

Constructor Details

This class inherits a constructor from Adaptors::Adaptor

Instance Method Details

#adapt(value) ⇒ Object



52
53
54
55
56
57
58
# File 'lib/bureaucrat/validation_old.rb', line 52

def adapt(value)
  begin
    make_float(value)
  rescue ArgumentError
    fail_with(:not_float)
  end
end