require "patternmatching" include PatternMatching class Person def initialize(name, age) @name = name @age = age end attr :name attr :age end # Example for matching Object except Hash person = Person.new("Jiro", 3) make person do seems as {{:name => :name}} do puts "He is " + name end seems something do puts "no name" end end # => "He is Jiro"