Module: Toji::Processing::SoakedRice
- Defined in:
- lib/toji/processing/soaked_rice.rb
Instance Method Summary collapse
-
#soaked ⇒ Object
浸漬米総重量.
-
#soaking_ratio ⇒ Object
浸漬米吸水率.
-
#soaking_ratio_sd ⇒ Object
浸漬米吸水率の標準偏差.
-
#weight ⇒ Object
白米総重量.
Instance Method Details
#soaked ⇒ Object
浸漬米総重量
31 32 33 |
# File 'lib/toji/processing/soaked_rice.rb', line 31 def soaked (elements || []).map(&:soaked).sum end |
#soaking_ratio ⇒ Object
浸漬米吸水率
36 37 38 |
# File 'lib/toji/processing/soaked_rice.rb', line 36 def soaking_ratio (soaked.to_f - weight.to_f) / weight.to_f end |
#soaking_ratio_sd ⇒ Object
浸漬米吸水率の標準偏差
41 42 43 44 45 46 |
# File 'lib/toji/processing/soaked_rice.rb', line 41 def soaking_ratio_sd mean = soaking_ratio samples = (elements || []).map(&:soaking_ratio) length = samples.length.to_f Math.sqrt(samples.map{|sample| (sample - mean) ** 2}.sum / length) end |
#weight ⇒ Object
白米総重量
26 27 28 |
# File 'lib/toji/processing/soaked_rice.rb', line 26 def weight (elements || []).map(&:weight).sum end |