Module: Zakuro::Calculation::Summary::Day
- Defined in:
- lib/zakuro/calculation/summary/internal/day.rb
Overview
Day 特定日
Class Method Summary collapse
Class Method Details
.get(month:, date: Western::Calendar.new) ⇒ Calculation::Base::Day
日を取得する
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/zakuro/calculation/summary/internal/day.rb', line 25 def get(month:, date: Western::Calendar.new) first_date = month.western_date days = date - first_date remainder = month.remainder remainder = remainder.add( # 常に参照元のRemainderクラスで生成する remainder.class.new(day: days, minute: 0, second: 0) ) Calculation::Base::Day.new( number: days + 1, western_date: date, remainder: remainder ) end |