require "patternmatching" include PatternMatching class Foo def initialize @name = "Foo" end attr :name def bar make "bar" do seems as {:val} do @name = val end end end func(:buzz).seems as {:val} do @name = val end end o = Foo.new o.bar p o.name #=> "bar" o.buzz("buzz") p o.name #=> "buzz"