Class: RightnowOms::OrderNoGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/rightnow_oms/order_no_generator.rb

Constant Summary collapse

NO_FORMAT =
'%s%06d'

Instance Method Summary collapse

Constructor Details

#initialize(order) ⇒ OrderNoGenerator

Returns a new instance of OrderNoGenerator.



5
6
7
# File 'lib/rightnow_oms/order_no_generator.rb', line 5

def initialize(order)
  @order = order
end

Instance Method Details

#generateObject



9
10
11
# File 'lib/rightnow_oms/order_no_generator.rb', line 9

def generate
  NO_FORMAT % [@order.created_at.strftime('%Y%m%d'), @order.id]
end