Parent

Files

Class/Module Index [+]

Quicksearch

Chef::VersionConstraint

Attributes

op[R]
version[R]

Public Class Methods

new(constraint_spec=DEFAULT_CONSTRAINT) click to toggle source
# File lib/chef/version_constraint.rb, line 28
def initialize(constraint_spec=DEFAULT_CONSTRAINT)
  case constraint_spec
  when nil
    parse(DEFAULT_CONSTRAINT)
  when Array
    parse_from_array(constraint_spec)
  when String
    parse(constraint_spec)
  else
    msg = "VersionConstraint should be created from a String. You gave: #{constraint_spec.inspect}"
    raise Chef::Exceptions::InvalidVersionConstraint, msg
  end
end

Public Instance Methods

==(o) click to toggle source
Alias for: eql?
eql?(o) click to toggle source
# File lib/chef/version_constraint.rb, line 59
def eql?(o)
  o.class == self.class && @op == o.op && @version == o.version
end
Also aliased as: ==
include?(v) click to toggle source
# File lib/chef/version_constraint.rb, line 42
def include?(v)
  version = if v.respond_to? :version # a CookbookVersion-like object
              Chef::Version.new(v.version.to_s)
            else
              Chef::Version.new(v.to_s)
            end
 do_op(version)
end
inspect() click to toggle source
# File lib/chef/version_constraint.rb, line 51
def inspect
  "(#{@op} #{@version})"
end
to_s() click to toggle source
# File lib/chef/version_constraint.rb, line 55
def to_s
  "#{@op} #{@version}"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.