Class: Object

Inherits:
BasicObject
Defined in:
lib/sometimes.rb

Overview

half_the_time do sometimes do

Instance Method Summary collapse

Instance Method Details

#half_the_time(&block) ⇒ Object Also known as: sometimes



37
38
39
# File 'lib/sometimes.rb', line 37

def half_the_time(&block)
  50.percent_of_the_time {yield}
end

#rarely(&block) ⇒ Object



42
43
44
# File 'lib/sometimes.rb', line 42

def rarely(&block)
  5.percent_of_the_time {yield}
end