Module: OsCtld::Utils::Assets

Instance Method Summary collapse

Instance Method Details

#list_and_validate_assets(entity) ⇒ Object

Parameters:

  • entity (#assets)


4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/osctld/utils/assets.rb', line 4

def list_and_validate_assets(entity)
  validator = Assets::Validator.new(entity.assets)
  validator.validate.map do |asset|
    {
      type: asset.type,
      path: asset.path,
      opts: asset.opts,
      state: asset.state,
      errors: asset.errors
    }
  end
end