Class: Stat

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/rforward/stat.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStat

Returns a new instance of Stat.



5
6
7
# File 'lib/rforward/stat.rb', line 5

def initialize
  @success, @failed, @total, @files_total, @files_current, @flush_counter = 0, 0, 0, 0, 0, 0
end

Instance Attribute Details

#failedObject

Returns the value of attribute failed.



3
4
5
# File 'lib/rforward/stat.rb', line 3

def failed
  @failed
end

#files_currentObject

Returns the value of attribute files_current.



3
4
5
# File 'lib/rforward/stat.rb', line 3

def files_current
  @files_current
end

#files_totalObject

Returns the value of attribute files_total.



3
4
5
# File 'lib/rforward/stat.rb', line 3

def files_total
  @files_total
end

#flush_counterObject

Returns the value of attribute flush_counter.



3
4
5
# File 'lib/rforward/stat.rb', line 3

def flush_counter
  @flush_counter
end

#successObject

Returns the value of attribute success.



3
4
5
# File 'lib/rforward/stat.rb', line 3

def success
  @success
end

#totalObject

Returns the value of attribute total.



3
4
5
# File 'lib/rforward/stat.rb', line 3

def total
  @total
end

Instance Method Details

#to_sObject



9
10
11
12
13
14
15
16
# File 'lib/rforward/stat.rb', line 9

def to_s
  text = []
  text << "[STAT]"
  text << "[total: #{total}] [success: #{success}] [failed #{failed}]"
  text << "[file current #{files_current}] [files total #{files_total}]"
  text << "[STAT]"
  text.join "\n"
end