Class: LCBO::CrawlKit::VolumeHelper
- Inherits:
-
Object
- Object
- LCBO::CrawlKit::VolumeHelper
- Defined in:
- lib/lcbo/crawlkit/volume_helper.rb
Instance Attribute Summary collapse
-
#package_volume ⇒ Object
readonly
Returns the value of attribute package_volume.
-
#total_units ⇒ Object
readonly
Returns the value of attribute total_units.
-
#unit_type ⇒ Object
readonly
Returns the value of attribute unit_type.
-
#unit_volume ⇒ Object
readonly
Returns the value of attribute unit_volume.
Class Method Summary collapse
Instance Method Summary collapse
- #as_milliliters ⇒ Object
-
#initialize(input) ⇒ VolumeHelper
constructor
A new instance of VolumeHelper.
Constructor Details
#initialize(input) ⇒ VolumeHelper
Returns a new instance of VolumeHelper.
7 8 9 10 11 12 13 14 |
# File 'lib/lcbo/crawlkit/volume_helper.rb', line 7 def initialize(input) @input = input @package_volume = 0 @unit_volume = 0 @total_units = 0 calculate self end |
Instance Attribute Details
#package_volume ⇒ Object (readonly)
Returns the value of attribute package_volume.
5 6 7 |
# File 'lib/lcbo/crawlkit/volume_helper.rb', line 5 def package_volume @package_volume end |
#total_units ⇒ Object (readonly)
Returns the value of attribute total_units.
5 6 7 |
# File 'lib/lcbo/crawlkit/volume_helper.rb', line 5 def total_units @total_units end |
#unit_type ⇒ Object (readonly)
Returns the value of attribute unit_type.
5 6 7 |
# File 'lib/lcbo/crawlkit/volume_helper.rb', line 5 def unit_type @unit_type end |
#unit_volume ⇒ Object (readonly)
Returns the value of attribute unit_volume.
5 6 7 |
# File 'lib/lcbo/crawlkit/volume_helper.rb', line 5 def unit_volume @unit_volume end |
Class Method Details
.[](input_string) ⇒ Object
16 17 18 |
# File 'lib/lcbo/crawlkit/volume_helper.rb', line 16 def self.[](input_string) new(input_string).as_milliliters end |
Instance Method Details
#as_milliliters ⇒ Object
20 21 22 |
# File 'lib/lcbo/crawlkit/volume_helper.rb', line 20 def as_milliliters @package_volume end |