Skip to content

Commit

Permalink
Added bin file
Browse files Browse the repository at this point in the history
  • Loading branch information
plribeiro3000 committed Nov 7, 2014
1 parent 84ecebf commit ad95c0f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions lib/fog/bin/voxel.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
class Voxel < Fog::Bin
class << self
def class_for(key)
case key
when :compute
Fog::Compute::Voxel
else
raise ArgumentError, "Unrecognized service: #{key}"
end
end

def [](service)
@@connections ||= Hash.new do |hash, key|
hash[key] = case key
when :compute
Fog::Logger.warning("Voxel[:compute] is not recommended, use Compute[:voxel] for portability")
Fog::Compute.new(:provider => 'Voxel')
else
raise ArgumentError, "Unrecognized service: #{key.inspect}"
end
end
@@connections[service]
end

def services
Fog::Voxel.services
end
end
end

0 comments on commit ad95c0f

Please sign in to comment.