Class: Toji::Calendar::DateRow

Inherits:
Object
  • Object
show all
Defined in:
lib/toji/calendar/date_row.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date) ⇒ DateRow

Returns a new instance of DateRow.



8
9
10
11
12
# File 'lib/toji/calendar/date_row.rb', line 8

def initialize(date)
  @date = date
  @kojis = []
  @kakes = []
end

Instance Attribute Details

#dateObject (readonly)

Returns the value of attribute date.



4
5
6
# File 'lib/toji/calendar/date_row.rb', line 4

def date
  @date
end

#kakesObject (readonly)

Returns the value of attribute kakes.



6
7
8
# File 'lib/toji/calendar/date_row.rb', line 6

def kakes
  @kakes
end

#kojisObject (readonly)

Returns the value of attribute kojis.



5
6
7
# File 'lib/toji/calendar/date_row.rb', line 5

def kojis
  @kojis
end

Instance Method Details

#<<(schedule) ⇒ Object Also known as: add



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/toji/calendar/date_row.rb', line 14

def <<(schedule)
  case schedule.rice_type
  when :koji
    index = schedule.step_weights.first[:index]
    @kojis[index] ||= DateColumn.new
    @kojis[index] << schedule
  when :kake
    index = schedule.step_weights.first[:index]
    @kakes[index] ||= DateColumn.new
    @kakes[index] << schedule
  end
end