Class: Toji::Calendar::DateColumn

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDateColumn

Returns a new instance of DateColumn.



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

def initialize
  @rice_schedules = []
end

Instance Attribute Details

#rice_schedulesObject (readonly)

Returns the value of attribute rice_schedules.



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

def rice_schedules
  @rice_schedules
end

Instance Method Details

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



10
11
12
# File 'lib/toji/calendar/date_column.rb', line 10

def <<(schedule)
  @rice_schedules << schedule
end

#textObject



15
16
17
18
19
20
21
# File 'lib/toji/calendar/date_column.rb', line 15

def text
  @rice_schedules.map {|schedule|
    serial_num = schedule.product.serial_num
    weight = "%.17g" % schedule.expect.weight
    "#{serial_num}: #{weight}"
  }.join("<br>")
end