Class: SlackScratcher::Loader::File

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/slack_scratcher/loader/file.rb

Instance Method Summary collapse

Constructor Details

#initialize(target_dir) ⇒ File


8
9
10
11
12
13
14
# File 'lib/slack_scratcher/loader/file.rb', line 8

def initialize(target_dir)
  fail ArgumentError unless ::File.directory?(target_dir)

  @target = target_dir
  @users = load_users
  @channels = load_channels
end

Instance Method Details

#eachObject


16
17
18
19
20
21
22
# File 'lib/slack_scratcher/loader/file.rb', line 16

def each
  files.each do |file|
    yield parse_log_file(file), file
  end

  true
end