Sha256: 1c7606c82c2e25f4db77a8e0b40a20fef7aaa25c1ad43f466dc28dbd3f5d5a21

Contents?: true

Size: 532 Bytes

Versions: 2

Compression:

Stored size: 532 Bytes

Contents

require 'chef_fs/file_system/base_fs_object'
require 'chef_fs/file_system/nonexistent_fs_object'

module ChefFS
  module FileSystem
    class BaseFSDir < BaseFSObject
      def initialize(name, parent)
        super
      end

      def dir?
        true
      end

      # Override child(name) to provide a child object by name without the network read
      def child(name)
        children.select { |child| child.name == name }.first || NonexistentFSObject.new(name, self)
      end

      # Abstract: children
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
knife-essentials-0.1.1 lib/chef_fs/file_system/base_fs_dir.rb
knife-essentials-0.1 lib/chef_fs/file_system/base_fs_dir.rb