Class: Contracts::Stringy::Float
- Inherits:
-
Object
- Object
- Contracts::Stringy::Float
- Defined in:
- lib/contracts/stringy.rb
Class Method Summary collapse
Class Method Details
.generate(*args) ⇒ Object
30 31 32 |
# File 'lib/contracts/stringy.rb', line 30 def self.generate(*args) ::Float.generate(*args).to_s end |
.valid?(value) ⇒ Boolean
26 27 28 |
# File 'lib/contracts/stringy.rb', line 26 def self.valid?(value) value.is_a? String and (value =~ FLOAT_REGEX) != nil end |