Class: Fog::Kubevirt::Compute::Shared::ExceptionWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/kubevirt/compute/compute.rb

Instance Method Summary collapse

Constructor Details

#initialize(client, version) ⇒ ExceptionWrapper

Returns a new instance of ExceptionWrapper.



88
89
90
91
# File 'lib/fog/kubevirt/compute/compute.rb', line 88

def initialize(client, version)
  @client = client
  @version = version
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args) ⇒ Object



93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/fog/kubevirt/compute/compute.rb', line 93

def method_missing(symbol, *args)
  super unless @client.respond_to?(symbol)

  if block_given?
    @client.__send__(symbol, *args) do |*block_args|
      yield(*block_args)
    end
  else
    @client.__send__(symbol, *args)
  end
rescue KubeException => e
  raise ::Fog::Kubevirt::Errors::ClientError, e
end

Instance Method Details

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


107
108
109
# File 'lib/fog/kubevirt/compute/compute.rb', line 107

def respond_to_missing?(method_name, include_private = false)
  @client.respond_to?(symbol, include_all) || super
end

#versionObject



111
112
113
# File 'lib/fog/kubevirt/compute/compute.rb', line 111

def version
  @version
end