Module: BusinessCalendar

Defined in:
lib/business_calendar.rb,
lib/business_calendar/version.rb

Defined Under Namespace

Modules: Shim Classes: Calendar, HolidayDeterminer

Constant Summary collapse

CountryNotSupported =
Class.new(StandardError)
OrganizationNotSupported =
Class.new(StandardError)
VERSION =
"3.0.1"

Class Method Summary collapse

Class Method Details

.for(country, options = {}) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/business_calendar.rb', line 7

def for(country, options = {})
  if options["use_cached_calendar"]
    calendar_cache[country] ||= Calendar.new(holiday_determiner(country))
  else
    Calendar.new(holiday_determiner(country), options)
  end
end

.for_endpoint(additions, removals, options = {}) ⇒ Object



19
20
21
# File 'lib/business_calendar.rb', line 19

def for_endpoint(additions, removals, options = {})
  Calendar.new(holiday_determiner_for_endpoint(additions, removals, options), options)
end

.for_organization(org, options = {}) ⇒ Object



15
16
17
# File 'lib/business_calendar.rb', line 15

def for_organization(org, options = {})
  Calendar.new(holiday_determiner_for_organization(org), options)
end