Class: EasyJSONMatcher::NumberValidator

Inherits:
Validator
  • Object
show all
Defined in:
lib/easy_json_matcher/number_validator.rb

Instance Attribute Summary

Attributes inherited from Validator

#content, #key

Instance Method Summary collapse

Methods inherited from Validator

#_set_content, #initialize, #valid?

Constructor Details

This class inherits a constructor from EasyJSONMatcher::Validator

Instance Method Details

#_validateObject



5
6
7
8
9
10
11
12
# File 'lib/easy_json_matcher/number_validator.rb', line 5

def _validate
  begin
    Kernel::Float(content)
    true
  rescue ArgumentError => e
    false
  end
end