class ChefDK::Policyfile::SolutionDependencies::Cookbook

Constants

VALID_STRING_FORMAT

Public Class Methods

parse(str) click to toggle source
# File lib/chef-dk/policyfile/solution_dependencies.rb, line 37
def self.parse(str)
  name, version_w_parens = str.split(" ")
  version = version_w_parens[/\(([^)]+)\)/, 1]
  new(name, version)
end
valid_str?(str) click to toggle source
# File lib/chef-dk/policyfile/solution_dependencies.rb, line 33
def self.valid_str?(str)
  !!(str =~ VALID_STRING_FORMAT)
end

Public Instance Methods

eql?(other) click to toggle source
# File lib/chef-dk/policyfile/solution_dependencies.rb, line 47
def eql?(other)
  other.is_a?(self.class) &&
    other.name == name &&
    other.version == version
end
hash() click to toggle source
# File lib/chef-dk/policyfile/solution_dependencies.rb, line 53
def hash
  [name, version].hash
end
to_s() click to toggle source
# File lib/chef-dk/policyfile/solution_dependencies.rb, line 43
def to_s
  "#{name} (#{version})"
end