Sha256: 69494a3d340f9ef21005a9357cea36b6df04f82bba12a5c2d5a3fe51b1048633
Contents?: true
Size: 730 Bytes
Versions: 42
Compression:
Stored size: 730 Bytes
Contents
require 'fog/collection' require 'fog/slicehost/models/server' module Fog module Slicehost class Mock def servers Fog::Slicehost::Servers.new(:connection => self) end end class Real def servers Fog::Slicehost::Servers.new(:connection => self) end end class Servers < Fog::Collection model Fog::Slicehost::Server def all data = connection.get_slices.body['slices'] load(data) end def get(server_id) if server_id && server = connection.get_slice(server_id).body new(server) elsif !server_id nil end rescue Excon::Errors::Forbidden nil end end end end
Version data entries
42 entries across 42 versions & 1 rubygems