Method: OpsWalrus::RemoteImportInvocationContext#_invoke_if_namespace_has_ops_file_of_same_name

Defined in:
lib/opswalrus/invocation.rb

#_invoke_if_namespace_has_ops_file_of_same_name(*args, **kwargs, &block) ⇒ Object

if this namespace contains an OpsFile of the same name as the namespace, e.g. pkg/install/install.ops, then this method invokes the OpsFile of that same name and returns the result; otherwise we return this namespace object



77
78
79
80
81
82
83
84
85
# File 'lib/opswalrus/invocation.rb', line 77

def _invoke_if_namespace_has_ops_file_of_same_name(*args, **kwargs, &block)
  method_name = @namespace_or_ops_file.dirname.basename
  resolved_symbol = @namespace_or_ops_file.resolve_symbol(method_name)
  if resolved_symbol.is_a? OpsFile
    _resolve_method_and_invoke(method_name)
  else
    self
  end
end