Class: Google4R::Checkout::Weight

Inherits:
Unit
  • Object
show all
Defined in:
lib/google4r/checkout/shared.rb

Overview

This defines item weight

Constant Summary collapse

LB =

Constants for unit

'LB'

Instance Attribute Summary

Attributes inherited from Unit

#unit, #value

Instance Method Summary collapse

Methods inherited from Unit

create_from_element

Constructor Details

#initialize(value, unit = LB) ⇒ Weight

Returns a new instance of Weight.



1136
1137
1138
1139
# File 'lib/google4r/checkout/shared.rb', line 1136

def initialize(value, unit=LB)
  @unit = unit
  @value = BigDecimal.new(value.to_s)
end