lib/octofacts_updater/fact_index.rb
# Add a fact to the index. If the fact already exists in the index, this will overwrite it.
#
# fact_name - A String with the name of the fact
# fixtures  - An Array with fact fixtures (must respond to .facts and .hostname)
Add a fact to the index. If the fact already exists in the index, this will overwrite it.
fact_name - A String with the name of the fact
fixtures  - An Array with fact fixtures (must respond to .facts and .hostname)
Add a fact to the index . If the fact already exists in the index this will overwrite it . fact_name - A String with the name of the fact fixtures - An Array with fact fixtures ( must respond to . facts and . hostname )
def add(fact_name, fixtures)
      @index_data[fact_name] ||= {}
      fixtures.each do |fixture|
        fact_value = get_fact(fixture, fact_name)
        next if fact_value.nil?
        @index_data[fact_name][fact_value] ||= []
        @index_data[fact_name][fact_value] << fixture.hostname
      end
    end
def add ( fact_name , fixtures ) @index_data [ fact_name ] ||= { } fixtures . each do | fixture | fact_value = get_fact ( fixture , fact_name ) next if fact_value . nil? @index_data [ fact_name ] [ fact_value ] ||= [ ] @index_data [ fact_name ] [ fact_value ] << fixture . hostname end end
Add a fact to the index.
Add a fact to the index .
fact_name
<not_specific>
fixtures
<not_specific>