mirror of
https://github.com/inspec/inspec
synced 2024-12-03 18:09:32 +00:00
simplify nested params retrieval
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
parent
55a26cfba7
commit
dcc790b8a9
1 changed files with 2 additions and 4 deletions
|
@ -23,11 +23,9 @@ class SshConf < Vulcano.resource(1)
|
|||
end
|
||||
|
||||
def params(*opts)
|
||||
res = @params
|
||||
opts.each do |opt|
|
||||
res = res[opt] unless res.nil?
|
||||
opts.inject(read_params) do |cur, acc|
|
||||
cur.respond_to?(:key) ? cur[acc] : nil
|
||||
end
|
||||
res
|
||||
end
|
||||
|
||||
def method_missing(name)
|
||||
|
|
Loading…
Reference in a new issue