Class: LogStats::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/logstats.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_file, output_path) ⇒ Base

Returns a new instance of Base.



8
9
10
11
12
# File 'lib/logstats.rb', line 8

def initialize(source_file, output_path)
  @worklog=WorkLog.new(source_file)
  @output_path=output_path
  @base_path=File.dirname(__FILE__)
end

Instance Attribute Details

#worklogObject (readonly)

Returns the value of attribute worklog.



6
7
8
# File 'lib/logstats.rb', line 6

def worklog
  @worklog
end

Instance Method Details

#generate!Object



14
15
16
17
18
19
20
# File 'lib/logstats.rb', line 14

def generate!
  # Calculate the stats from the file
  locals={}
  @worklog.stats.each { |key, data| locals[key]=data }
  process_haml(locals)
  return true
end