toji 1.6.3 → 1.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/toji/schedule/calendar.rb +22 -4
- data/lib/toji/schedule/date_column.rb +2 -1
- data/lib/toji/schedule/product.rb +4 -1
- data/lib/toji/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea7f317a8523e02571115e31cddcd0c5f02aed9a89d64cb8ff58955545817f5c
|
4
|
+
data.tar.gz: 0c431190ff6c2120477f50e778043f7b2163d1f18d25168c635187b37610c000
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e10824774f5b262428d06f60c5b8b57d5d7545f0a35dc15728423eba2fe9d8fdeddde865a007adc52448e6636f75a6c43a74a4c0dd4d8540a59f7747c7ef85b
|
7
|
+
data.tar.gz: eb02aca9c2f3754c2abd31bd07aaa9cd32482d5e0ed42e99345ff61ec02cd9ba644df235ad288eef7c730bf52344a17fa8a6a2388168869bad385db734f9498c
|
@@ -63,14 +63,14 @@ module Toji
|
|
63
63
|
date_row = _date_rows[date]
|
64
64
|
if date_row
|
65
65
|
koji_len.times {|i|
|
66
|
-
columns << (date_row.kojis[i]&.
|
66
|
+
columns << (date_row.kojis[i]&.to_h_a || [])
|
67
67
|
}
|
68
68
|
rice_len.times {|i|
|
69
|
-
columns << (date_row.rices[i]&.
|
69
|
+
columns << (date_row.rices[i]&.to_h_a || [])
|
70
70
|
}
|
71
71
|
else
|
72
72
|
(koji_len + rice_len).times {
|
73
|
-
columns <<
|
73
|
+
columns << []
|
74
74
|
}
|
75
75
|
end
|
76
76
|
|
@@ -82,8 +82,26 @@ module Toji
|
|
82
82
|
{header: headers, rows: rows}
|
83
83
|
end
|
84
84
|
|
85
|
-
def
|
85
|
+
def table_text_data
|
86
86
|
data = table_data
|
87
|
+
data[:rows] = data[:rows].map {|row|
|
88
|
+
row.map {|column|
|
89
|
+
if Array===column
|
90
|
+
column.map{|c|
|
91
|
+
name = c[:product_name]
|
92
|
+
weight = "%.17g" % c[:weight]
|
93
|
+
"#{name}: #{weight}"
|
94
|
+
}.join("<br>")
|
95
|
+
else
|
96
|
+
column
|
97
|
+
end
|
98
|
+
}
|
99
|
+
}
|
100
|
+
data
|
101
|
+
end
|
102
|
+
|
103
|
+
def table
|
104
|
+
data = table_text_data
|
87
105
|
|
88
106
|
Plotly::Plot.new(
|
89
107
|
data: [{
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Toji
|
2
2
|
module Schedule
|
3
3
|
class Product
|
4
|
+
attr_reader :id
|
4
5
|
attr_reader :name
|
5
6
|
attr_reader :description
|
6
7
|
attr_reader :recipe
|
@@ -10,7 +11,8 @@ module Toji
|
|
10
11
|
|
11
12
|
attr_reader :color
|
12
13
|
|
13
|
-
def initialize(name, description, recipe, koji_dates, rice_dates, color=nil)
|
14
|
+
def initialize(id, name, description, recipe, koji_dates, rice_dates, color=nil)
|
15
|
+
@id = id
|
14
16
|
@name = name
|
15
17
|
@description = description
|
16
18
|
@recipe = recipe
|
@@ -64,6 +66,7 @@ module Toji
|
|
64
66
|
end
|
65
67
|
|
66
68
|
new(
|
69
|
+
args[:id],
|
67
70
|
args[:name],
|
68
71
|
args[:description],
|
69
72
|
recipe,
|
data/lib/toji/version.rb
CHANGED