Class: Chef::Attribute::Validator::WildcardExpander::NoWildcards

Inherits:
Chef::Attribute::Validator::WildcardExpander show all
Defined in:
lib/chef-attribute-validator/wildcard_expander/no_wildcards.rb

Instance Attribute Summary

Attributes inherited from Chef::Attribute::Validator::WildcardExpander

#node, #path_spec

Instance Method Summary collapse

Methods inherited from Chef::Attribute::Validator::WildcardExpander

choose, #convert_step_to_integer, #fetch_val_by_slashpath, #initialize, #path_contains_wildcards?, #path_exists_by_slashpath?, #slashpath_to_steps

Constructor Details

This class inherits a constructor from Chef::Attribute::Validator::WildcardExpander

Instance Method Details

#expand_allObject



9
10
11
12
13
14
15
# File 'lib/chef-attribute-validator/wildcard_expander/no_wildcards.rb', line 9

def expand_all
  if path_exists_by_slashpath?(path_spec)
    [ path_spec ]
  else
    [ ]
  end
end

#suitabilityObject



17
18
19
20
21
22
23
# File 'lib/chef-attribute-validator/wildcard_expander/no_wildcards.rb', line 17

def suitability
  if path_contains_wildcards?(path_spec)
    0.0
  else
    1.0
  end
end