lib/fog/bluebox/requests/compute/create_block.rb in fog-1.22.0 vs lib/fog/bluebox/requests/compute/create_block.rb in fog-1.22.1

- old
+ new

@@ -1,10 +1,9 @@ module Fog module Compute class Bluebox class Real - # Create a new block # # ==== Parameters # * product_id<~String> - ID of block product (size) # * template_id<~String> - ID of block OS/build template @@ -17,12 +16,11 @@ # # ==== Returns # * response<~Excon::Response>: # * body<~Hash>: def create_block(product_id, template_id, location_id, options = {}) - - unless options.has_key?('password') || options.has_key?('ssh_public_key') + unless options.key?('password') || options.key?('ssh_public_key') raise ArgumentError, 'Either password or public_key must be supplied' end query = { 'product' => product_id, @@ -38,10 +36,9 @@ :path => '/api/blocks.json', :query => query, :body => options.map {|k,v| "#{CGI.escape(k)}=#{CGI.escape(v)}"}.join('&') ) end - end end end end