Formula: add set_acitve_spec method
This commit is contained in:
parent
03facd8554
commit
21eecbf1d6
@ -119,6 +119,16 @@ class Formula
|
|||||||
@pin = FormulaPin.new(self)
|
@pin = FormulaPin.new(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @private
|
||||||
|
def set_active_spec(spec_sym)
|
||||||
|
spec = send(spec_sym)
|
||||||
|
raise FormulaSpecificationError, "#{spec_sym} spec is not available for #{full_name}" unless spec
|
||||||
|
@active_spec = spec
|
||||||
|
@active_spec_sym = spec_sym
|
||||||
|
validate_attributes!
|
||||||
|
@build = active_spec.build
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def set_spec(name)
|
def set_spec(name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user