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 Fog
|
||||||
module Slicehost
|
module Slicehost
|
||||||
|
|
||||||
|
class Mock
|
||||||
def flavors
|
def flavors
|
||||||
Fog::Slicehost::Flavors.new(:connection => self)
|
Fog::Slicehost::Flavors.new(:connection => self)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class Real
|
||||||
|
def flavors
|
||||||
|
Fog::Slicehost::Flavors.new(:connection => self)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
class Flavors < Fog::Collection
|
class Flavors < Fog::Collection
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,21 @@ require 'fog/slicehost/models/image'
|
||||||
module Fog
|
module Fog
|
||||||
module Slicehost
|
module Slicehost
|
||||||
|
|
||||||
|
class Mock
|
||||||
def images(attributes = {})
|
def images(attributes = {})
|
||||||
Fog::Slicehost::Images.new({
|
Fog::Slicehost::Images.new({
|
||||||
:connection => self
|
:connection => self
|
||||||
}.merge!(attributes))
|
}.merge!(attributes))
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class Real
|
||||||
|
def images(attributes = {})
|
||||||
|
Fog::Slicehost::Images.new({
|
||||||
|
:connection => self
|
||||||
|
}.merge!(attributes))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
class Images < Fog::Collection
|
class Images < Fog::Collection
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,17 @@ require 'fog/slicehost/models/server'
|
||||||
module Fog
|
module Fog
|
||||||
module Slicehost
|
module Slicehost
|
||||||
|
|
||||||
|
class Mock
|
||||||
def servers
|
def servers
|
||||||
Fog::Slicehost::Servers.new(:connection => self)
|
Fog::Slicehost::Servers.new(:connection => self)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class Real
|
||||||
|
def servers
|
||||||
|
Fog::Slicehost::Servers.new(:connection => self)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
class Servers < Fog::Collection
|
class Servers < Fog::Collection
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue