Module: Zakuro::Calculation::Summary::Japan::Specifier::SingleDay

Defined in:
lib/zakuro/calculation/summary/japan/specifier/single_day.rb

Overview

SingleDay 一日検索

Constant Summary collapse

LOGGER =
Output::Logger.new(location: 'specifier')

Class Method Summary collapse

Class Method Details

.get(years: [], date: Japan::Calendar.new) ⇒ Result::Data::SingleDay

取得する



39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/zakuro/calculation/summary/japan/specifier/single_day.rb', line 39

def get(years: [], date: Japan::Calendar.new)
  year, month = specify(years: years, date: date)
  first_date = month.western_date.clone
  days = date.day - 1
  western_date = first_date + days
  day = Day.get(month: month, date: western_date)

  options = Option.create(month: month, day: day)

  Output::Response::SingleDay.create(
    year: year, month: month, day: day, options: options
  )
end