Class: Kitkat::Reader

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/kitkat/reader.rb

Overview

Directory operations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ Reader

Returns a new instance of Reader.



12
13
14
15
16
# File 'lib/kitkat/reader.rb', line 12

def initialize(root)
  @root = File.expand_path(root)

  freeze
end

Instance Attribute Details

#rootObject (readonly)

Returns the value of attribute root.



10
11
12
# File 'lib/kitkat/reader.rb', line 10

def root
  @root
end

Instance Method Details

#eachObject



18
19
20
21
22
23
24
# File 'lib/kitkat/reader.rb', line 18

def each(&)
  return enum_for(:each) unless block_given?

  traverse(root, &)

  self
end