Class RandomGenerators::RandomGenerator
In: lib/random_generators/random_generator.rb
Parent: Object

Methods

Included Modules

Abstract

Public Instance methods

[Source]

# File lib/random_generators/random_generator.rb, line 20
    def check_choose_float ( f )
      unless f.is_a? Float
        raise ArgumentError, "Need a float (not #{f})"
      end
      if f <= 0
        raise ArgumentError, "Need an positive value (not #{f})"
      end
    end

[Source]

# File lib/random_generators/random_generator.rb, line 11
    def check_choose_integer ( n )
      unless n.is_a? Integer
        raise ArgumentError, "Need an integer (not #{n})"
      end
      if n <= 0
        raise ArgumentError, "Need an positive value (not #{n})"
      end
    end

[Validate]