# File lib/smart_proxy_salt/salt.rb, line 24 def method_missing(m, *args, &block) # Use API, if it supports it, otherwise fallback to the CLI if Proxy::Salt::Plugin.settings.use_api && Proxy::Salt::Rest.respond_to?(m) Proxy::Salt::Rest.send(m, *args, &block) elsif Proxy::Salt::CLI.respond_to?(m) Proxy::Salt::CLI.send(m, *args, &block) elsif !Proxy::Salt::Plugin.settings.use_api && Proxy::Salt::Rest.respond_to?(m) raise NotImplementedError.new('You must enable the Salt API to use this feature.') else super end end