Sha256: 32ebf2b5dd015a98d68bc96d94e4d4e96cead1eaf8c21ea972d20e17804fe30c

Contents?: true

Size: 552 Bytes

Versions: 4

Compression:

Stored size: 552 Bytes

Contents

require "fog/core/collection"
require "fog/brightbox/models/compute/account"

module Fog
  module Compute
    class Brightbox
      class Accounts < Fog::Collection
        model Fog::Compute::Brightbox::Account

        def all
          data = service.list_accounts
          load(data)
        end

        def get(identifier)
          return nil if identifier.nil? || identifier == ""
          data = service.get_account(identifier)
          new(data)
        rescue Excon::Errors::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
fog-brightbox-0.7.2 lib/fog/brightbox/models/compute/accounts.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-brightbox-0.7.1/lib/fog/brightbox/models/compute/accounts.rb
fog-brightbox-0.7.1 lib/fog/brightbox/models/compute/accounts.rb
fog-brightbox-0.7.0 lib/fog/brightbox/models/compute/accounts.rb