mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
29 lines
500 B
Ruby
29 lines
500 B
Ruby
|
module Fog
|
||
|
module Compute
|
||
|
class Joyent
|
||
|
|
||
|
class Mock
|
||
|
def get_dataset(id)
|
||
|
if ds = self.data[:datasets][id]
|
||
|
res = Excon::Response.new
|
||
|
res.status = 200
|
||
|
res.body = ds
|
||
|
else
|
||
|
raise Excon::Errors::NotFound
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
class Real
|
||
|
def get_dataset
|
||
|
request(
|
||
|
:method => "GET",
|
||
|
:path => "/my/datasets"
|
||
|
)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
end
|
||
|
end
|
||
|
end
|