Sha256: 66aee5adb908999a2dba40e98685a3baaf34b43580e06f4689fe90c3ae89b0bc

Contents?: true

Size: 379 Bytes

Versions: 4

Compression:

Stored size: 379 Bytes

Contents

class Fab

  # Fab a boolean, either true or false.
  #
  # @return [boolean] either true or false.
  #
  def boolean
    [true, false].sample
  end

  # Fab a rating, such as 1 to 5 stars.
  #
  # Options:
  #
  #   * min: 1
  #   * max: 5
  #
  # @return [Fixnum] a random number
  #
  def rating(options = {})
    rand((options[:min] || 1)..(options[:max] || 5))
  end

end


Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sixarm_ruby_fab-1.0.4 lib/sixarm_ruby_fab/basic.rb
sixarm_ruby_fab-1.0.2 lib/sixarm_ruby_fab/basic.rb
sixarm_ruby_fab-1.0.1 lib/sixarm_ruby_fab/basic.rb
sixarm_ruby_fab-1.0.0 lib/sixarm_ruby_fab/basic.rb