Class: Array

Inherits:
Object show all
Defined in:
lib/chef/sugar/core_extensions/array.rb

Instance Method Summary collapse

Instance Method Details

#satisfied_by?(version) ⇒ Boolean

Treat an array of objects as version constraints.

Examples:

Using pure Array<String> objects like constraints

['> 2.0.0', '< 3.0.0'].satisfied_by?('2.1.0')

Parameters:

  • version (String)

    the version to check if it is satisfied

Returns:

  • (Boolean)

See Also:


31
32
33
# File 'lib/chef/sugar/core_extensions/array.rb', line 31

def satisfied_by?(version)
  Chef::Sugar::Constraints::Constraint.new(*dup).satisfied_by?(version)
end