Class: ServiceTrack::CreateEntregaRapida
- Inherits:
-
Object
- Object
- ServiceTrack::CreateEntregaRapida
- Defined in:
- lib/service_track/create_entrega_rapida.rb
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ CreateEntregaRapida
constructor
A new instance of CreateEntregaRapida.
- #nuevas_expediciones ⇒ Object
- #save ⇒ Object
- #terminar_facturacion ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ CreateEntregaRapida
Returns a new instance of CreateEntregaRapida.
3 4 5 |
# File 'lib/service_track/create_entrega_rapida.rb', line 3 def initialize(opts = {}) @opts = opts end |
Instance Method Details
#nuevas_expediciones ⇒ Object
19 20 21 22 23 24 |
# File 'lib/service_track/create_entrega_rapida.rb', line 19 def nuevas_expediciones @comprobante_temps_generados.each do |comprobante| @opts[:comprobante_temp_id] = comprobante.id NuevaExpedicion.new(@opts).save end end |
#save ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/service_track/create_entrega_rapida.rb', line 7 def save ActiveRecord::Base.transaction do terminar_facturacion nuevas_expediciones # con los comprobantes generados en el paso anterior # comprobar coherencia? end end |
#terminar_facturacion ⇒ Object
15 16 17 |
# File 'lib/service_track/create_entrega_rapida.rb', line 15 def terminar_facturacion @comprobante_temps_generados = TerminarFacturacion.new(@opts).save end |