Class: Brewscribe::Carbonation
- Inherits:
-
Object
- Object
- Brewscribe::Carbonation
- Includes:
- Conversion
- Defined in:
- lib/brewscribe/carbonation.rb
Constant Summary collapse
- TYPES =
['Bottle', 'Keg', 'Keg with priming agent']
- KEY_CONVERSION =
{ carb_rate: PERCENT_CONV, temperature: FLOAT_CONV, type: ->(t) { TYPES[t.to_i] }, last_modified: DATE_CONV }
Constants included from Conversion
Brewscribe::Conversion::BOOLEAN_CONV, Brewscribe::Conversion::DATE_CONV, Brewscribe::Conversion::FLOAT_CONV, Brewscribe::Conversion::INT_CONV, Brewscribe::Conversion::PERCENT_CONV
Instance Attribute Summary collapse
-
#carb_rate ⇒ Object
Returns the value of attribute carb_rate.
-
#last_modified ⇒ Object
Returns the value of attribute last_modified.
-
#name ⇒ Object
Returns the value of attribute name.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#primer_name ⇒ Object
Returns the value of attribute primer_name.
-
#temperature ⇒ Object
Returns the value of attribute temperature.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Methods included from Conversion
Instance Attribute Details
#carb_rate ⇒ Object
Returns the value of attribute carb_rate.
3 4 5 |
# File 'lib/brewscribe/carbonation.rb', line 3 def carb_rate @carb_rate end |
#last_modified ⇒ Object
Returns the value of attribute last_modified.
3 4 5 |
# File 'lib/brewscribe/carbonation.rb', line 3 def last_modified @last_modified end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/brewscribe/carbonation.rb', line 3 def name @name end |
#notes ⇒ Object
Returns the value of attribute notes.
3 4 5 |
# File 'lib/brewscribe/carbonation.rb', line 3 def notes @notes end |
#primer_name ⇒ Object
Returns the value of attribute primer_name.
3 4 5 |
# File 'lib/brewscribe/carbonation.rb', line 3 def primer_name @primer_name end |
#temperature ⇒ Object
Returns the value of attribute temperature.
3 4 5 |
# File 'lib/brewscribe/carbonation.rb', line 3 def temperature @temperature end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/brewscribe/carbonation.rb', line 3 def type @type end |
Class Method Details
.from_data(data) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/brewscribe/carbonation.rb', line 16 def self.from_data data carb = new carb.data_to_properties data carb end |