Sha256: 5f3ac31912f41cab84107dc4cb8de53d596030bb924c045c11373bfcc5465bca

Contents?: true

Size: 444 Bytes

Versions: 2

Compression:

Stored size: 444 Bytes

Contents

module Knife
  class PartialSearch
    class FakeNode < Hash
      def name
        self['name']
      end
      def chef_environment
        self['chef_environment']
      end
      def run_list
        self['run_list'].join(', ')
      end

      def [](key)
        super(key.to_s)
      end

      def kind_of?(klass)
        if klass.to_s == 'Chef::Node'
          true
        else
          super
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
knife-partial-search-0.0.4 lib/chef/knife/partial_search/fake_node.rb
knife-partial-search-0.0.3 lib/chef/knife/partial_search/fake_node.rb