Skip to content

Instantly share code, notes, and snippets.

@ezr-ondrej
Created March 23, 2019 13:34
Show Gist options
  • Save ezr-ondrej/2b194609864cf10c7de5d650ad9f168b to your computer and use it in GitHub Desktop.
Save ezr-ondrej/2b194609864cf10c7de5d650ad9f168b to your computer and use it in GitHub Desktop.
module Fog
module Vsphere
class Compute
class Real
def create_vm(attributes = {})
# NOW
# stufff goes here....
# AFTER
CreateVmRequest.new(connection).call(attributes)
end
# This methods would move to command specific class
private
# command specific
end
end
end
end
module Fog
module Vsphere
module Requests
# inherits some common behaviour
class CreateVmRequest < VsphereComputeRequest
def initialize(connection)
@connection = connection
end
def call(attributes)
# stufff
end
private
# command specific methods
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment