class Chef::Taste::Dependency

The class that contains information about a dependent cookbook

Attributes

changelog[RW]

The changelog link for the dependency if available

latest[RW]

The latest version available for the dependency

name[R]

The name of the dependency

requirement[R]

The requirement for the dependency

source_url[RW]

The source URL for a cookbook

status[RW]

The status of the dependency

version_used[RW]

The version of cookbook used after applying the version constraint

Public Class Methods

new(name, requirement) click to toggle source

Constructor

@param name [String] the name of the dependent cookbook @param requirement [String] the version requirement for dependent cookbook

@return [Dependency] the Dependency object

# File lib/chef/taste/dependency.rb, line 61
def initialize(name, requirement)
  @name = name
  @requirement = requirement
  @version_used = nil
  @latest = nil
  @status = nil
  @source_url = nil
  @changelog = nil
end

Public Instance Methods

to_hash() click to toggle source

Converts the dependency option to a hash

@return [Hash] the hash representation of the dependency object

# File lib/chef/taste/dependency.rb, line 75
def to_hash
  {}.tap do |hash|
    hash[:requirement] = requirement
    hash[:used] = version_used
    hash[:latest] = latest
    hash[:status] = status
    hash[:changelog] = changelog
  end
end