Class: Jamef::Cubage
- Inherits:
-
Object
- Object
- Jamef::Cubage
- Defined in:
- lib/jamef/cubage.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
Returns the value of attribute items.
Instance Method Summary collapse
-
#initialize(items) ⇒ Cubage
constructor
A new instance of Cubage.
- #price ⇒ Object
- #to_s ⇒ Object
- #total ⇒ Object
- #weight ⇒ Object
Constructor Details
#initialize(items) ⇒ Cubage
Returns a new instance of Cubage.
6 7 8 |
# File 'lib/jamef/cubage.rb', line 6 def initialize(items) @items = items.kind_of?(Array) ? items : [items] end |
Instance Attribute Details
#items ⇒ Object
Returns the value of attribute items.
4 5 6 |
# File 'lib/jamef/cubage.rb', line 4 def items @items end |
Instance Method Details
#price ⇒ Object
18 19 20 |
# File 'lib/jamef/cubage.rb', line 18 def price Elegible.new('+', price_sum) end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/jamef/cubage.rb', line 14 def to_s Elegible.new('+', cubage_sum).to_s end |