Class: Crusoe::EntryFileName

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

Constant Summary collapse

DATE_SEPARATOR =
"-".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry, entries_directory) ⇒ EntryFileName

Returns a new instance of EntryFileName.



8
9
10
11
# File 'lib/crusoe/entry_file_name.rb', line 8

def initialize(entry, entries_directory)
  @entry = entry
  @entries_directory = entries_directory
end

Instance Attribute Details

#entries_directoryObject (readonly)

Returns the value of attribute entries_directory.



4
5
6
# File 'lib/crusoe/entry_file_name.rb', line 4

def entries_directory
  @entries_directory
end

#entryObject (readonly)

Returns the value of attribute entry.



3
4
5
# File 'lib/crusoe/entry_file_name.rb', line 3

def entry
  @entry
end

Instance Method Details

#to_file_pathObject Also known as: to_s



13
14
15
16
17
# File 'lib/crusoe/entry_file_name.rb', line 13

def to_file_path
  File.join(entries_directory,
            month_directory_name,
            file_name) + file_format
end