Class: VagrantPlugins::Linode::ClientWrapper
- Inherits:
-
Object
- Object
- VagrantPlugins::Linode::ClientWrapper
- Defined in:
- lib/vagrant-linode/client_wrapper.rb
Instance Method Summary collapse
-
#initialize(client, logger) ⇒ ClientWrapper
constructor
A new instance of ClientWrapper.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(client, logger) ⇒ ClientWrapper
Returns a new instance of ClientWrapper.
6 7 8 9 |
# File 'lib/vagrant-linode/client_wrapper.rb', line 6 def initialize(client, logger) @client = client @logger = logger end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/vagrant-linode/client_wrapper.rb', line 11 def method_missing(method, *args, &block) result = @client.send(method, *args, &block) if result.is_a? LinodeAPI::Retryable self.class.new(result, @logger) else result end rescue ::LinodeAPI::APIError => e @logger.error e.details.inspect raise end |