Module: Validations::Predicates::Decimal::Methods

Included in:
Validations::Predicates::Decimal
Defined in:
lib/endpoint_flux/tasks/endpoint_flux/generators/endpoint_flux/validations/predicates/decimal.rb

Instance Method Summary collapse

Instance Method Details

#decimal?(input) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
13
# File 'lib/endpoint_flux/tasks/endpoint_flux/generators/endpoint_flux/validations/predicates/decimal.rb', line 7

def decimal?(input)
  begin
    true if BigDecimal(input)
  rescue ArgumentError, TypeError
    false
  end
end