Class: Gemgento::Shipment
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Gemgento::Shipment
- Defined in:
- app/models/gemgento/shipment.rb
Overview
Instance Attribute Summary collapse
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#email ⇒ Object
Returns the value of attribute email.
-
#include_comment ⇒ Object
Returns the value of attribute include_comment.
Instance Method Summary collapse
Instance Attribute Details
#comment ⇒ Object
Returns the value of attribute comment.
11 12 13 |
# File 'app/models/gemgento/shipment.rb', line 11 def comment @comment end |
#email ⇒ Object
Returns the value of attribute email.
11 12 13 |
# File 'app/models/gemgento/shipment.rb', line 11 def email @email end |
#include_comment ⇒ Object
Returns the value of attribute include_comment.
11 12 13 |
# File 'app/models/gemgento/shipment.rb', line 11 def include_comment @include_comment end |
Instance Method Details
#as_json(options = nil) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'app/models/gemgento/shipment.rb', line 17 def as_json( = nil) result = super result['items'] = self.shipment_items result['comments'] = self.shipment_comments result['tracks'] = self.shipment_tracks return result end |
#push_to_magento ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'app/models/gemgento/shipment.rb', line 26 def push_to_magento increment_id = API::SOAP::Sales::OrderShipment.create(self) if increment_id == false return false else self.increment_id = increment_id self.save end end |
#send_email ⇒ Object
13 14 15 |
# File 'app/models/gemgento/shipment.rb', line 13 def send_email API::SOAP::Sales::OrderShipment.send_info(self.increment_id) end |