Created
March 23, 2019 13:34
-
-
Save ezr-ondrej/2b194609864cf10c7de5d650ad9f168b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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