Class: Brewscribe::Mash::Step

Inherits:
Object
  • Object
show all
Includes:
Conversion
Defined in:
lib/brewscribe/mash/step.rb

Constant Summary collapse

TYPES =
['Infusion', 'Decoction', 'Temperature']
KEY_CONVERSION =
{
  last_modified: DATE_CONV,
  type: ->(t) { TYPES[t.to_i] },
  infusion: FLOAT_CONV,
  step_temp: FLOAT_CONV,
  step_time: INT_CONV,
  rise_time: INT_CONV,
  tun_addition: FLOAT_CONV,
  tun_vol: FLOAT_CONV,
  tun_temp: FLOAT_CONV,
  tun_mass: FLOAT_CONV,
  start_temp: FLOAT_CONV,
  grain_temp: FLOAT_CONV,
  start_vol: FLOAT_CONV,
  grain_weight: FLOAT_CONV,
  infusion_temp: FLOAT_CONV,
  decoction_amt: FLOAT_CONV,
  tun_hc: FLOAT_CONV
}

Constants included from Conversion

Conversion::BOOLEAN_CONV, Conversion::DATE_CONV, Conversion::FLOAT_CONV, Conversion::INT_CONV, Conversion::PERCENT_CONV

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from Conversion

#data_to_properties

Instance Attribute Details

#decoction_amtObject

Returns the value of attribute decoction_amt.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def decoction_amt
  @decoction_amt
end

#grain_tempObject

Returns the value of attribute grain_temp.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def grain_temp
  @grain_temp
end

#grain_weightObject

Returns the value of attribute grain_weight.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def grain_weight
  @grain_weight
end

#infusionObject

Returns the value of attribute infusion.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def infusion
  @infusion
end

#infusion_tempObject

Returns the value of attribute infusion_temp.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def infusion_temp
  @infusion_temp
end

#last_modifiedObject

Returns the value of attribute last_modified.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def last_modified
  @last_modified
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def name
  @name
end

#rise_timeObject

Returns the value of attribute rise_time.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def rise_time
  @rise_time
end

#start_tempObject

Returns the value of attribute start_temp.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def start_temp
  @start_temp
end

#start_volObject

Returns the value of attribute start_vol.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def start_vol
  @start_vol
end

#step_tempObject

Returns the value of attribute step_temp.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def step_temp
  @step_temp
end

#step_timeObject

Returns the value of attribute step_time.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def step_time
  @step_time
end

#tun_additionObject

Returns the value of attribute tun_addition.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def tun_addition
  @tun_addition
end

#tun_hcObject

Returns the value of attribute tun_hc.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def tun_hc
  @tun_hc
end

#tun_massObject

Returns the value of attribute tun_mass.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def tun_mass
  @tun_mass
end

#tun_tempObject

Returns the value of attribute tun_temp.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def tun_temp
  @tun_temp
end

#tun_volObject

Returns the value of attribute tun_vol.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def tun_vol
  @tun_vol
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/brewscribe/mash/step.rb', line 4

def type
  @type
end

Class Method Details

.from_data(data) ⇒ Object



33
34
35
36
37
38
# File 'lib/brewscribe/mash/step.rb', line 33

def self.from_data data
  step = new 
  step.data_to_properties data
  
  step
end