Class: RsrGroup::OrderDetail
Constant Summary
Constants inherited from Base
Base::DEFAULT_CATALOG_FILENAME, Base::DEFAULT_DIR, Base::KEYDEALER_CATALOG_FILENAME, Base::KEYDEALER_DIR, Base::MAP_FILENAME, Base::QTY_FILENAME
Instance Attribute Summary collapse
-
#order_identifier ⇒ Object
readonly
Returns the value of attribute order_identifier.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ OrderDetail
constructor
A new instance of OrderDetail.
- #to_single_line ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(options = {}) ⇒ OrderDetail
Returns a new instance of OrderDetail.
7 8 9 10 11 12 13 14 15 |
# File 'lib/rsr_group/order_detail.rb', line 7 def initialize( = {}) requires!(, :order_identifier, :rsr_stock_number, :quantity, :shipping_carrier, :shipping_method) @order_identifier = [:order_identifier] @rsr_stock_number = [:rsr_stock_number] @quantity = ([:quantity].is_a?(Integer) ? ("%05d" % [:quantity]) : [:quantity]) @shipping_carrier = [:shipping_carrier] @shipping_method = [:shipping_method] end |
Instance Attribute Details
#order_identifier ⇒ Object (readonly)
Returns the value of attribute order_identifier.
4 5 6 |
# File 'lib/rsr_group/order_detail.rb', line 4 def order_identifier @order_identifier end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
5 6 7 |
# File 'lib/rsr_group/order_detail.rb', line 5 def quantity @quantity end |
Instance Method Details
#to_single_line ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rsr_group/order_detail.rb', line 17 def to_single_line [ order_identifier, LINE_TYPES.key(:order_detail), @rsr_stock_number, @quantity, @shipping_carrier, @shipping_method ].join(";") end |