mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[slicehost] add mock/real model helpers
This commit is contained in:
parent
509bf6e469
commit
20edaa3097
3 changed files with 34 additions and 8 deletions
|
@ -4,9 +4,17 @@ require 'fog/slicehost/models/flavor'
|
|||
module Fog
|
||||
module Slicehost
|
||||
|
||||
class Mock
|
||||
def flavors
|
||||
Fog::Slicehost::Flavors.new(:connection => self)
|
||||
end
|
||||
end
|
||||
|
||||
class Real
|
||||
def flavors
|
||||
Fog::Slicehost::Flavors.new(:connection => self)
|
||||
end
|
||||
end
|
||||
|
||||
class Flavors < Fog::Collection
|
||||
|
||||
|
|
|
@ -4,11 +4,21 @@ require 'fog/slicehost/models/image'
|
|||
module Fog
|
||||
module Slicehost
|
||||
|
||||
class Mock
|
||||
def images(attributes = {})
|
||||
Fog::Slicehost::Images.new({
|
||||
:connection => self
|
||||
}.merge!(attributes))
|
||||
end
|
||||
end
|
||||
|
||||
class Real
|
||||
def images(attributes = {})
|
||||
Fog::Slicehost::Images.new({
|
||||
:connection => self
|
||||
}.merge!(attributes))
|
||||
end
|
||||
end
|
||||
|
||||
class Images < Fog::Collection
|
||||
|
||||
|
|
|
@ -4,9 +4,17 @@ 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
|
||||
|
||||
|
|
Loading…
Reference in a new issue