This is a simple method taking multiple blocks demonstration.
The script takes one parameter: it could be an age or a birth date(DD-MM-YYYY). Then it tries to find out what age range does the person belongs to.
When the input string is submitted, the program runs a series of tests ("modifiers") to find out what type of data has been entered: a date or a number.
Each modifier validates input and throws and exception when the input is invalid. The recursive "Validate" method calls the cascade of modifiers according to the validator's tree. For demonstration purpose, every test result is shown.
##Usage
$ ruby ./blocks.rb 10.10.1980
isNotNull: passed
isNumber: failed
isDate: passed
isAge: passed
isChildAge: failed
isAdultAge: passed
isSeniorAge: failed
$ ruby ./blocks.rb 8
isNotNull: passed
isNumber: passed
isAge: passed
isChildAge: passed
isAdultAge: failed
isSeniorAge: failed
isDate: failed
Very specific and somewhat hard to read.