Environment.[]() allows specifying the type of variable you want returned
This commit is contained in:
parent
46c50049aa
commit
975f6b06c8
@ -34,8 +34,15 @@ module Rscons
|
||||
end
|
||||
end
|
||||
|
||||
def [](key)
|
||||
@variables[key]
|
||||
def [](key, type = nil)
|
||||
val = @variables[key]
|
||||
if type == :array
|
||||
val.is_a?(String) ? [val] : val
|
||||
elsif type == :string
|
||||
val.is_a?(Array) ? val.first : val
|
||||
else
|
||||
val
|
||||
end
|
||||
end
|
||||
|
||||
def []=(key, val)
|
||||
|
Loading…
x
Reference in New Issue
Block a user