Class: HolidayCo::Day

Inherits:
Object
  • Object
show all
Defined in:
lib/holiday_co/models/day.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date) ⇒ Day

Returns a new instance of Day.



8
9
10
# File 'lib/holiday_co/models/day.rb', line 8

def initialize(date)
  @date = date.to_s
end

Instance Attribute Details

#dateObject (readonly)

Returns the value of attribute date.



6
7
8
# File 'lib/holiday_co/models/day.rb', line 6

def date
  @date
end

Instance Method Details

#holiday?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/holiday_co/models/day.rb', line 12

def holiday?
  holiday_dates.include?(date)
end