require "patternmatching" include PatternMatching class Foo def initialize @name = "Foo" end attr :name def foo end def bar make "bar" do seems as {:val} do foo # To access fields like this.name or this.name = ... the.name = val # To access self as this this end end end func(:buzz).seems as {:val} do the.name = val this end end o = Foo.new p o.bar == o #=> true p o.name #=> "bar" p o.buzz("buzz") == o #=> true p o.name #=> "buzz"