-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathshipment_address_update.rb
More file actions
39 lines (33 loc) · 946 Bytes
/
shipment_address_update.rb
File metadata and controls
39 lines (33 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module Newgistics
class ShipmentAddressUpdate
include Newgistics::Model
attribute :id, String
attribute :order_id, String
attribute :company, String
attribute :first_name, String
attribute :last_name, String
attribute :address1, String
attribute :address2, String
attribute :city, String
attribute :state, String
attribute :postal_code, String
attribute :country, String
attribute :email, String
attribute :phone, String
attribute :fax, String
attribute :is_residential, Boolean
attribute :status, String
attribute :status_notes, String
attribute :ship_method, String
attribute :success, Boolean
attribute :errors, Array[String], default: []
attribute :warnings, Array[String], default: []
def success?
!!success
end
def save
Requests::UpdateShipmentAddress.new(self).perform
errors.empty? && success?
end
end
end