Class: Object

Inherits:
BasicObject
Includes:
Curse
Defined in:
lib/curse.rb

Constant Summary

Constants included from Curse

Curse::VERSION

Instance Method Summary collapse

Methods included from Curse

#adverbs, #curses, language=, register

Instance Method Details

#curse(other = nil) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/curse.rb', line 47

def curse(other = nil)
  if other
    "#{self}: #{ Kernel.adverbs.join(' ') } #{other}"
  else
    "#{self}: #{Kernel.curses}"
  end
end

#curse!Object



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/curse.rb', line 55

def curse!

  (methods - Object.methods).sample(4).each do |method|

    define_singleton_method method do |*args|
      puts self.curse
      rand(20)
    end

  end

end