Class: Inspec::Plugin::V2::PluginType::Input

Inherits:
Inspec::Plugin::V2::PluginBase show all
Defined in:
lib/inspec/plugin/v2/plugin_types/input.rb

Instance Method Summary collapse

Methods inherited from Inspec::Plugin::V2::PluginBase

base_class_for_type, find_name_by_implementation_class, plugin_name, register_plugin_type, registry

Instance Method Details

#default_priorityObject

When an input is obtained from the plugin, this number determines what precedence to assign to the input.

Returns:

  • Integer range 0-100. Higher priority means higher precedence



13
14
15
# File 'lib/inspec/plugin/v2/plugin_types/input.rb', line 13

def default_priority
  60
end

#fetch(_profile_name, _input_name) ⇒ Object

Indicates an attempt is being made to read the value for an input. Return nil if the input is not supplied by the plugin, otherwise return the value.

Returns:

  • Object or nil

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/inspec/plugin/v2/plugin_types/input.rb', line 21

def fetch(_profile_name, _input_name)
  raise NotImplementedError, "Plugin #{plugin_name} must implement the #fetch method"
end

#list_inputs(_profile) ⇒ Object

Given a profile name, list all input names for which the plugin would offer a response. would offer a response.

Parameters:

  • String

    profile_name Name of the profile

Raises:

  • (NotImplementedError)


30
31
32
# File 'lib/inspec/plugin/v2/plugin_types/input.rb', line 30

def list_inputs(_profile)
  raise NotImplementedError, "Plugin #{plugin_name} must implement the #list_inputs method"
end