mirror of
https://github.com/inspec/inspec
synced 2024-09-21 06:51:56 +00:00
Don't meta-program if you don't need to.
Signed-off-by: Ryan Davis <zenspider@chef.io>
This commit is contained in:
parent
2490a88b9c
commit
aef285a1f6
1 changed files with 10 additions and 5 deletions
|
@ -18,11 +18,16 @@ module Inspec::Resources
|
|||
@platform = inspec.backend.platform
|
||||
end
|
||||
|
||||
# add helper methods for easy access of properties
|
||||
%w{family release arch}.each do |property|
|
||||
define_method(property.to_sym) do
|
||||
@platform[property]
|
||||
end
|
||||
def family
|
||||
@platform.family
|
||||
end
|
||||
|
||||
def release
|
||||
@platform.release
|
||||
end
|
||||
|
||||
def arch
|
||||
@platform.arch
|
||||
end
|
||||
|
||||
def families
|
||||
|
|
Loading…
Reference in a new issue