class Berkshelf::Lockfile::Graph::GraphItem
A single item inside the graph.
Attributes
The list of dependencies and their constraints.
@return [Hash<String, String>]
the list of dependencies for this graph item, where the key corresponds to the name of the dependency and the value is the version constraint.
The name of the cookbook that corresponds to this graph item.
@return [String]
the name of the cookbook
The locked version for this graph item.
@return [String]
the locked version of the graph item (as a string)
Public Class Methods
Source
# File lib/berkshelf/lockfile.rb, line 838 def initialize(name, version, dependencies = {}) @name = name.to_s @version = version.to_s @dependencies = dependencies end
Create a new graph item.
Public Instance Methods
Source
# File lib/berkshelf/lockfile.rb, line 850 def add_dependency(name, constraint) @dependencies[name.to_s] = constraint.to_s end
Add a new dependency to the list.
@param [#to_s] name
the name to use
@param [#to_s] constraint
the version constraint to use
Source
# File lib/berkshelf/lockfile.rb, line 854 def set_dependencies(dependencies) @dependencies = dependencies.to_hash end
Source
# File lib/berkshelf/lockfile.rb, line 859 def to_s "#{name} (#{version})" end
@private