Class: Object

Inherits:
BasicObject
Defined in:
lib/sometimes.rb

Overview

half_the_time do sometimes do

Instance Method Summary collapse

Instance Method Details

#alwaysObject



57
58
59
# File 'lib/sometimes.rb', line 57

def always
  yield
end

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



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

def half_the_time(&block)
  50.percent_of_the_time(&block)
end

#mostly(&block) ⇒ Object



51
52
53
# File 'lib/sometimes.rb', line 51

def mostly(&block)
  95.percent_of_the_time(&block)
end

#never(&block) ⇒ Object



55
# File 'lib/sometimes.rb', line 55

def never(&block); end

#rarely(&block) ⇒ Object



47
48
49
# File 'lib/sometimes.rb', line 47

def rarely(&block)
  5.percent_of_the_time(&block)
end