Class: Lite::Measurements::Base
- Inherits:
-
Object
- Object
- Lite::Measurements::Base
- Defined in:
- lib/lite/measurements/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(amount) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(amount) ⇒ Base
Returns a new instance of Base.
9 10 11 |
# File 'lib/lite/measurements/base.rb', line 9 def initialize(amount) @amount = amount end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
7 8 9 |
# File 'lib/lite/measurements/base.rb', line 7 def amount @amount end |
Class Method Details
.convert(amount, from:, to:) ⇒ Object
15 16 17 18 |
# File 'lib/lite/measurements/base.rb', line 15 def convert(amount, from:, to:) klass = new(amount) klass.convert(from: from, to: to) end |