Class: Toddler

Inherits:
Object
  • Object
show all
Defined in:
lib/toddler.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



3
4
5
6
7
8
# File 'lib/toddler.rb', line 3

def method_missing(method, *args, &block)
  current_hour = Time.now.hour

  current_hour == rand(23) ? (puts("No");sleep(5);puts("Yes")) : puts("No")

end