From: hemant Date: 2006-10-19T09:48:07+09:00 Subject: whats this lambda code doing? I came across following code in typo's application.rb and I can't understand the last part, def with_blog_scoped_classes(klasses=[Content, Article, Comment, Page, Trackback], &block) default_id = this_blog.id scope_hash = { :find => { :conditions => "blog_id = #{default_id}"}, :create => { :blog_id => default_id } } klasses.inject(block) do |blk, klass| lambda { klass.with_scope(scope_hash, &blk) } end.call end Method will be called with a block and will probably add some scope to the respective methods of ActiveRecord classes. But whats the last part? I mean, end.call? -- There was only one Road; that it was like a great river: its springs were at every doorstep, and every path was its tributary.