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,8 +4,16 @@ require 'fog/slicehost/models/flavor'
|
|||
module Fog
|
||||
module Slicehost
|
||||
|
||||
def flavors
|
||||
Fog::Slicehost::Flavors.new(:connection => self)
|
||||
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,10 +4,20 @@ require 'fog/slicehost/models/image'
|
|||
module Fog
|
||||
module Slicehost
|
||||
|
||||
def images(attributes = {})
|
||||
Fog::Slicehost::Images.new({
|
||||
:connection => self
|
||||
}.merge!(attributes))
|
||||
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,8 +4,16 @@ require 'fog/slicehost/models/server'
|
|||
module Fog
|
||||
module Slicehost
|
||||
|
||||
def servers
|
||||
Fog::Slicehost::Servers.new(:connection => self)
|
||||
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