module ChefAPI

DEBUG steps:

check .chomp

Constants

UNSET

@todo Document this and why it's important

VERSION

Public Class Methods

connection() click to toggle source

API connection object based off the configured options in {Configurable}.

@return [ChefAPI::Connection]

# File lib/chef-api.rb, line 65
def connection
  unless @connection && @connection.same_options?(options)
    @connection = ChefAPI::Connection.new(options)
  end

  @connection
end
log_level() click to toggle source

Get the current log level.

@return [Symbol]

# File lib/chef-api.rb, line 46
def log_level
  ChefAPI::Log.level
end
log_level=(level) click to toggle source

Set the log level.

@example Set the log level to :info

ChefAPI.log_level = :info

@param [Symbol] level

the log level to set
# File lib/chef-api.rb, line 37
def log_level=(level)
  ChefAPI::Log.level = level
end
method_missing(m, *args, &block) click to toggle source

Delegate all methods to the connection object, essentially making the module object behave like a {Connection}.

Calls superclass method
# File lib/chef-api.rb, line 77
def method_missing(m, *args, &block)
  if connection.respond_to?(m)
    connection.send(m, *args, &block)
  else
    super
  end
end
respond_to_missing?(m, include_private = false) click to toggle source

Delegating respond_to to the {Connection}.

Calls superclass method
# File lib/chef-api.rb, line 88
def respond_to_missing?(m, include_private = false)
  connection.respond_to?(m) || super
end
root() click to toggle source

The source root of the ChefAPI gem. This is useful when requiring files that are relative to the root of the project.

@return [Pathname]

# File lib/chef-api.rb, line 56
def root
  @root ||= Pathname.new(File.expand_path("../../", __FILE__))
end