Make keg_only validation lazy

This commit is contained in:
Jack Nagel 2014-04-01 21:35:22 -05:00
parent 4830bdb5b7
commit 8f1f1d8d8a

View File

@ -8,14 +8,15 @@ class KegOnlyReason
def initialize reason, explanation=nil def initialize reason, explanation=nil
@reason = reason @reason = reason
@explanation = explanation @explanation = explanation
@valid = case @reason
when :provided_pre_mountain_lion then MacOS.version < :mountain_lion
else true
end
end end
def valid? def valid?
@valid case @reason
when :provided_pre_mountain_lion
MacOS.version < :mountain_lion
else
true
end
end end
def to_s def to_s