Class: Suspect::Storage::DirPath

Inherits:
Object
  • Object
show all
Defined in:
lib/suspect/storage/dir_path.rb

Instance Method Summary collapse

Constructor Details

#initialize(base_path, clock) ⇒ DirPath



4
5
6
7
# File 'lib/suspect/storage/dir_path.rb', line 4

def initialize(base_path, clock)
  @base_path = base_path
  @clock = clock
end

Instance Method Details

#expand_pathObject



9
10
11
12
13
14
# 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_sObject



16
17
18
# File 'lib/suspect/storage/dir_path.rb', line 16

def to_s
  expand_path
end