class Streamliner::Counter
Attributes
controller[R]
counter[R]
Public Class Methods
new(controller, counter)
click to toggle source
# File lib/streamliner/counter.rb, line 8 def initialize(controller, counter) @controller = controller @counter = counter || Hash.new(0) ensure_start_date end
Public Instance Methods
add()
click to toggle source
# File lib/streamliner/counter.rb, line 14 def add counter[controller] += 1 counter end
Private Instance Methods
ensure_start_date()
click to toggle source
# File lib/streamliner/counter.rb, line 21 def ensure_start_date if counter[:start] == 0 counter[:start] = DateTime.now end end