From 0759cce3c2a5354858358cb0d0f6b168a2f0e6e7 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 4 Jun 2013 11:05:02 -0500 Subject: Extract attr_rw from Formula for reuse Closes #20239. --- Library/Homebrew/compilers.rb | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'Library/Homebrew/compilers.rb') diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index 43d8ea900..80826237a 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -6,19 +6,12 @@ end class CompilerFailure attr_reader :compiler + attr_rw :build, :cause def initialize compiler, &block @compiler = compiler instance_eval(&block) if block_given? - @build ||= 9999 - end - - def build val=nil - val.nil? ? @build.to_i : @build = val.to_i - end - - def cause val=nil - val.nil? ? @cause : @cause = val + @build = (@build || 9999).to_i end end -- cgit v1.2.3