Sha256: 74b5fec05627cea701d2cd4aa2a874734fb7398b39b32c898b5f12c2a3a5884c
Contents?: true
Size: 503 Bytes
Versions: 3
Compression:
Stored size: 503 Bytes
Contents
require "yaml" module HolidayJp class Holidays attr_accessor :holidays def initialize @holidays = {} yaml = YAML.load_file(File.expand_path("../../../holidays.yml", __FILE__)) yaml.map do |key, value| @holidays[key] = Holiday.new(key, value) end end def between(start, last) holidays.find_all do |date, _holiday| start <= date && date <= last end.map(&:last) end def holiday?(date) holidays[date] end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
holiday_jp-0.7.1 | lib/holiday_jp/holidays.rb |
holiday_jp-0.7.0 | lib/holiday_jp/holidays.rb |
holiday_jp-0.6.1 | lib/holiday_jp/holidays.rb |