class Berichtsheft::Settings

Provides document specific information such as the resulting filename.

Attributes

file_path[RW]

Provides the path to save the output file. The file paht should always end with a slash. Example: '~/path/to/file/'

id_for_week[RW]

Provides the value for a workweek. The first week is the week, the employee has started working for the company.

Public Class Methods

new(id_for_week, file_path) click to toggle source
# File lib/berichtsheft/settings.rb, line 21
def initialize(id_for_week, file_path)
  @id_for_week = id_for_week if id_valid?(id_for_week)
  @file_path = file_path if File.directory?(file_path)
end

Public Instance Methods

id_valid?(id_for_week) click to toggle source

Working for over 4 years as an apprentice is implausible.

# File lib/berichtsheft/settings.rb, line 13
def id_valid?(id_for_week)
  if id_for_week > 0 && id_for_week < 251
    return true
  else
    raise ArgumentError
  end
end