class Suspect::Storage::DirPath

Attributes

base_path[R]
clock[R]

Public Class Methods

new(base_path, clock) click to toggle source
# File lib/suspect/storage/dir_path.rb, line 4
def initialize(base_path, clock)
  @base_path = base_path
  @clock = clock
end

Public Instance Methods

expand_path() click to toggle source
# File lib/suspect/storage/dir_path.rb, line 9
def expand_path
  File.join(base_path,
            format(clock.year),
            format(clock.month),
            format(clock.day))
end
to_s() click to toggle source
# File lib/suspect/storage/dir_path.rb, line 16
def to_s
  expand_path
end

Private Instance Methods

format(number) click to toggle source
# File lib/suspect/storage/dir_path.rb, line 24
def format(number)
  number.to_s.rjust(2, '0')
end