Skip to content

peczenyj/Frequency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frequency

Frequency is a small dsl written in ruby to work with frequency events (never, sometimes, always..)

Examples

Frequency is easy to use

require 'rubygems'
require 'frequency'

include Frequency

sometimes do
   puts "sometimes you can see this times, sometimes not"
end

never do
  puts "this line never will be print"
end

rarely :with_probability => 0.01 do
  puts "ok, its very rare..."
end

normally :with_probability => '24%' do
  puts "you can use strings instead float numbers"
end

always do
  puts "bye" 
end

the option with_probability does not work with never and always.

Install

[sudo] gem install frequency-dsl

Copyright © 2010 Tiago Peczenyj. See LICENSE for details.

About

A small dsl written in ruby to work with frequency events (never, sometimes, always..)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages