Sha256: 832e070f33c15b165f3033cebbf68d84545e550095bd96e0b177d6b63f621122
Contents?: true
Size: 816 Bytes
Versions: 48
Compression:
Stored size: 816 Bytes
Contents
require 'fog/collection' require 'fog/rackspace/models/servers/server' module Fog module Rackspace module Servers class Mock def servers Fog::Rackspace::Servers::Servers.new(:connection => self) end end class Real def servers Fog::Rackspace::Servers::Servers.new(:connection => self) end end class Servers < Fog::Collection model Fog::Rackspace::Servers::Server def all data = connection.list_servers_detail.body['servers'] load(data) end def get(server_id) if server = connection.get_server_details(server_id).body['server'] new(server) end rescue Excon::Errors::NotFound nil end end end end end
Version data entries
48 entries across 48 versions & 1 rubygems