class NoSE::Fields::FloatField

Field holding a float

Constants

TYPE

Public Class Methods

new(name, **options) click to toggle source
Calls superclass method NoSE::Fields::Field::new
# File lib/nose/model/fields.rb, line 184
def initialize(name, **options)
  super(name, 8, **options)
end
value_from_string(string) click to toggle source

Parse a Float from the provided parameter

# File lib/nose/model/fields.rb, line 189
def self.value_from_string(string)
  string.to_f
end

Public Instance Methods

random_value() click to toggle source

Random numbers up to the given size

# File lib/nose/model/fields.rb, line 194
def random_value
  rand(@cardinality).to_f
end