From a3315efde8209a007fec4997bd08615e1523df57 Mon Sep 17 00:00:00 2001 From: Oscar Del Ben Date: Wed, 4 Apr 2012 08:45:58 +0200 Subject: Use the more idiomatic tap method --- activemodel/lib/active_model/attribute_methods.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'activemodel/lib/active_model') diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb index 97a83e58af..d211122945 100644 --- a/activemodel/lib/active_model/attribute_methods.rb +++ b/activemodel/lib/active_model/attribute_methods.rb @@ -243,11 +243,7 @@ module ActiveModel # Returns true if the attribute methods defined have been generated. def generated_attribute_methods #:nodoc: - @generated_attribute_methods ||= begin - mod = Module.new - include mod - mod - end + @generated_attribute_methods ||= Module.new.tap { |mod| include mod } end protected -- cgit v1.2.3