Sha256: 1b83c7de43c93b1d3199cc50a6c938389765a58d0983a3c48c574cbaae90aaf3

Contents?: true

Size: 570 Bytes

Versions: 3

Compression:

Stored size: 570 Bytes

Contents

require 'fog/core/collection'
require 'fog/artifactory/models/storage/directory'

module Fog
  module Storage
    class Artifactory
      class Directories < Fog::Collection
        model Fog::Storage::Artifactory::Directory

        def all
          data = service.client.get('/api/repositories')
          load(data)
        end

        def get(key, _options = {})
          data = service.client.get("/api/repositories/#{key}")
          new(key: data['key'])
        rescue Artifactory::Error::HTTPError => _e
          nil
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-artifactory-0.3.0 lib/fog/artifactory/models/storage/directories.rb
fog-artifactory-0.2.0 lib/fog/artifactory/models/storage/directories.rb
fog-artifactory-0.1.0 lib/fog/artifactory/models/storage/directories.rb