Class: Renalware::HD::Scheduling::ArchiveArguments

Inherits:
Object
  • Object
show all
Defined in:
app/models/renalware/hd/scheduling/archive_arguments.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from: nil, to: nil) ⇒ ArchiveArguments

Returns a new instance of ArchiveArguments.



11
12
13
14
15
# File 'app/models/renalware/hd/scheduling/archive_arguments.rb', line 11

def initialize(from: nil, to: nil)
  @from_week_period = WeekPeriod.from_date(from || 1.year.ago)
  @up_until_date = (to || Time.zone.now - 1.day).to_date
  @to_week_period = WeekPeriod.from_date(@up_until_date)
end

Instance Attribute Details

#from_week_periodObject (readonly)

Returns the value of attribute from_week_period.



9
10
11
# File 'app/models/renalware/hd/scheduling/archive_arguments.rb', line 9

def from_week_period
  @from_week_period
end

#to_week_periodObject (readonly)

Returns the value of attribute to_week_period.



9
10
11
# File 'app/models/renalware/hd/scheduling/archive_arguments.rb', line 9

def to_week_period
  @to_week_period
end

#up_until_dateObject (readonly)

Returns the value of attribute up_until_date.



9
10
11
# File 'app/models/renalware/hd/scheduling/archive_arguments.rb', line 9

def up_until_date
  @up_until_date
end