Class: Brewscribe::Equipment

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

Constant Summary collapse

KEY_CONVERSION =
{
  last_modified: DATE_CONV,
  mash_vol: FLOAT_CONV,
  tun_mass: FLOAT_CONV,
  boil_rate_flag: BOOLEAN_CONV,
  boil_time: FLOAT_CONV,
  tun_specific_heat: FLOAT_CONV,
  tun_deadspace: FLOAT_CONV,
  tun_adj_deadspace: FLOAT_CONV,
  calc_boil: BOOLEAN_CONV,
  boil_vol: FLOAT_CONV,
  old_evap_rate: PERCENT_CONV,
  equip_39: BOOLEAN_CONV,
  boil_off: FLOAT_CONV,
  trub_loss: FLOAT_CONV,
  cool_pct: PERCENT_CONV,
  top_up_kettle: FLOAT_CONV,
  batch_vol: FLOAT_CONV,
  fermenter_loss: FLOAT_CONV,
  top_up: FLOAT_CONV,
  efficiency: ->(k) { k.to_f * 0.01 },
  hop_util: PERCENT_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

#batch_volObject

Returns the value of attribute batch_vol.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def batch_vol
  @batch_vol
end

#boil_offObject

Returns the value of attribute boil_off.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def boil_off
  @boil_off
end

#boil_rate_flagObject

Returns the value of attribute boil_rate_flag.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def boil_rate_flag
  @boil_rate_flag
end

#boil_timeObject

Returns the value of attribute boil_time.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def boil_time
  @boil_time
end

#boil_volObject

Returns the value of attribute boil_vol.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def boil_vol
  @boil_vol
end

#calc_boilObject

Returns the value of attribute calc_boil.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def calc_boil
  @calc_boil
end

#cool_pctObject

Returns the value of attribute cool_pct.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def cool_pct
  @cool_pct
end

#efficiencyObject

Returns the value of attribute efficiency.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def efficiency
  @efficiency
end

#equip_39Object

Returns the value of attribute equip_39.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def equip_39
  @equip_39
end

#fermenter_lossObject

Returns the value of attribute fermenter_loss.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def fermenter_loss
  @fermenter_loss
end

#hop_utilObject

Returns the value of attribute hop_util.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def hop_util
  @hop_util
end

#last_modifiedObject

Returns the value of attribute last_modified.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def last_modified
  @last_modified
end

#mash_volObject

Returns the value of attribute mash_vol.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def mash_vol
  @mash_vol
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def name
  @name
end

#notesObject

Returns the value of attribute notes.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def notes
  @notes
end

#old_evap_rateObject

Returns the value of attribute old_evap_rate.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def old_evap_rate
  @old_evap_rate
end

#top_upObject

Returns the value of attribute top_up.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def top_up
  @top_up
end

#top_up_kettleObject

Returns the value of attribute top_up_kettle.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def top_up_kettle
  @top_up_kettle
end

#trub_lossObject

Returns the value of attribute trub_loss.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def trub_loss
  @trub_loss
end

#tun_adj_deadspaceObject

Returns the value of attribute tun_adj_deadspace.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def tun_adj_deadspace
  @tun_adj_deadspace
end

#tun_deadspaceObject

Returns the value of attribute tun_deadspace.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def tun_deadspace
  @tun_deadspace
end

#tun_massObject

Returns the value of attribute tun_mass.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def tun_mass
  @tun_mass
end

#tun_specific_heatObject

Returns the value of attribute tun_specific_heat.



3
4
5
# File 'lib/brewscribe/equipment.rb', line 3

def tun_specific_heat
  @tun_specific_heat
end

Class Method Details

.from_data(data) ⇒ Object



35
36
37
38
39
40
# File 'lib/brewscribe/equipment.rb', line 35

def self.from_data data
  equipment = new 
  equipment.data_to_properties data

  equipment
end