class YARD::Handlers::Chef::ActionHandler

Handles “action” in a provider.

Public Instance Methods

process() click to toggle source
# File lib/yard-chef/handlers/action.rb, line 31
def process
  # Register the provider object
  provider_obj = lwrp
  provider_obj.map_resource(statement.file)
  provider_obj.add_file(statement.file)

  # Add provider to the cookbook to which it belongs
  cookbook_obj = cookbook
  unless cookbook_obj.providers.include?(provider_obj)
    cookbook_obj.providers.push(provider_obj)
  end
  provider_obj.cookbook = cookbook_obj

  # Register the action in the provider
  action_obj = ChefObject.register(provider_obj, name, :action)
  action_obj.source = statement.source
  action_obj.docstring = statement.docstring
  action_obj.add_file(statement.file, statement.line)
end