Class: Noths::Order
- Inherits:
-
Object
- Object
- Noths::Order
- Defined in:
- lib/noths/models/order.rb
Instance Attribute Summary collapse
-
#accepted_at ⇒ Object
Returns the value of attribute accepted_at.
-
#archived_at ⇒ Object
Returns the value of attribute archived_at.
-
#confirm_by ⇒ Object
Returns the value of attribute confirm_by.
-
#customer_expected_delivery_date ⇒ Object
Returns the value of attribute customer_expected_delivery_date.
-
#declined_at ⇒ Object
Returns the value of attribute declined_at.
-
#delivery_address ⇒ Object
Returns the value of attribute delivery_address.
-
#delivery_note ⇒ Object
Returns the value of attribute delivery_note.
-
#delivery_recipient_first_name ⇒ Object
Returns the value of attribute delivery_recipient_first_name.
-
#delivery_recipient_last_name ⇒ Object
Returns the value of attribute delivery_recipient_last_name.
-
#delivery_recipient_name ⇒ Object
Returns the value of attribute delivery_recipient_name.
-
#delivery_service ⇒ Object
Returns the value of attribute delivery_service.
-
#delivery_total ⇒ Object
Returns the value of attribute delivery_total.
-
#delivery_zone ⇒ Object
Returns the value of attribute delivery_zone.
-
#dispatch_note_viewed ⇒ Object
Returns the value of attribute dispatch_note_viewed.
-
#dispatch_overdue ⇒ Object
Returns the value of attribute dispatch_overdue.
-
#dispatched_at ⇒ Object
Returns the value of attribute dispatched_at.
-
#enquiry ⇒ Object
Returns the value of attribute enquiry.
-
#estimated_delivery_date ⇒ Object
Returns the value of attribute estimated_delivery_date.
-
#estimated_dispatch_at ⇒ Object
Returns the value of attribute estimated_dispatch_at.
-
#expired_at ⇒ Object
Returns the value of attribute expired_at.
-
#express ⇒ Object
Returns the value of attribute express.
-
#extra_refund_amount ⇒ Object
Returns the value of attribute extra_refund_amount.
-
#financials ⇒ Object
Returns the value of attribute financials.
-
#gift ⇒ Object
Returns the value of attribute gift.
-
#gift_message ⇒ Object
Returns the value of attribute gift_message.
-
#gift_receipt ⇒ Object
Returns the value of attribute gift_receipt.
-
#gift_wrap ⇒ Object
Returns the value of attribute gift_wrap.
-
#has_enquiry ⇒ Object
Returns the value of attribute has_enquiry.
-
#id ⇒ Object
Returns the value of attribute id.
-
#international ⇒ Object
Returns the value of attribute international.
-
#items ⇒ Object
Returns the value of attribute items.
-
#links ⇒ Object
Returns the value of attribute links.
-
#number ⇒ Object
Returns the value of attribute number.
-
#order_detail ⇒ Object
Returns the value of attribute order_detail.
-
#order_total ⇒ Object
Returns the value of attribute order_total.
-
#partner_name ⇒ Object
Returns the value of attribute partner_name.
-
#placed_at ⇒ Object
Returns the value of attribute placed_at.
-
#promotion_discount ⇒ Object
Returns the value of attribute promotion_discount.
-
#promotion_present ⇒ Object
Returns the value of attribute promotion_present.
-
#rebate_achieved ⇒ Object
null in sites where rebates are not offered.
-
#rebate_qualified ⇒ Object
null in sites where rebates are not offered.
-
#refund_total ⇒ Object
Returns the value of attribute refund_total.
-
#remaining_refund_amount ⇒ Object
Returns the value of attribute remaining_refund_amount.
-
#repeat_customer ⇒ Object
Returns the value of attribute repeat_customer.
-
#state ⇒ Object
Returns the value of attribute state.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Order
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Order
Initializes the object
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 |
# File 'lib/noths/models/order.rb', line 213 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} if attributes.has_key?(:'id') self.id = attributes[:'id'] end if attributes.has_key?(:'state') self.state = attributes[:'state'] end if attributes.has_key?(:'confirm_by') self.confirm_by = attributes[:'confirm_by'] end if attributes.has_key?(:'estimated_dispatch_at') self.estimated_dispatch_at = attributes[:'estimated_dispatch_at'] end if attributes.has_key?(:'placed_at') self.placed_at = attributes[:'placed_at'] end if attributes.has_key?(:'expired_at') self.expired_at = attributes[:'expired_at'] end if attributes.has_key?(:'declined_at') self.declined_at = attributes[:'declined_at'] end if attributes.has_key?(:'accepted_at') self.accepted_at = attributes[:'accepted_at'] end if attributes.has_key?(:'dispatched_at') self.dispatched_at = attributes[:'dispatched_at'] end if attributes.has_key?(:'archived_at') self.archived_at = attributes[:'archived_at'] end if attributes.has_key?(:'repeat_customer') self.repeat_customer = attributes[:'repeat_customer'] end if attributes.has_key?(:'customer_expected_delivery_date') self.customer_expected_delivery_date = attributes[:'customer_expected_delivery_date'] end if attributes.has_key?(:'number') self.number = attributes[:'number'] end if attributes.has_key?(:'dispatch_note_viewed') self.dispatch_note_viewed = attributes[:'dispatch_note_viewed'] end if attributes.has_key?(:'express') self.express = attributes[:'express'] end if attributes.has_key?(:'partner_name') self.partner_name = attributes[:'partner_name'] end if attributes.has_key?(:'delivery_recipient_name') self.delivery_recipient_name = attributes[:'delivery_recipient_name'] end if attributes.has_key?(:'delivery_recipient_first_name') self.delivery_recipient_first_name = attributes[:'delivery_recipient_first_name'] end if attributes.has_key?(:'delivery_recipient_last_name') self.delivery_recipient_last_name = attributes[:'delivery_recipient_last_name'] end if attributes.has_key?(:'international') self.international = attributes[:'international'] end if attributes.has_key?(:'dispatch_overdue') self.dispatch_overdue = attributes[:'dispatch_overdue'] end if attributes.has_key?(:'gift') self.gift = attributes[:'gift'] end if attributes.has_key?(:'gift_message') self. = attributes[:'gift_message'] end if attributes.has_key?(:'gift_wrap') self.gift_wrap = attributes[:'gift_wrap'] end if attributes.has_key?(:'gift_receipt') self.gift_receipt = attributes[:'gift_receipt'] end if attributes.has_key?(:'delivery_note') self.delivery_note = attributes[:'delivery_note'] end if attributes.has_key?(:'has_enquiry') self.has_enquiry = attributes[:'has_enquiry'] end if attributes.has_key?(:'estimated_delivery_date') self.estimated_delivery_date = attributes[:'estimated_delivery_date'] end if attributes.has_key?(:'rebate_qualified') self.rebate_qualified = attributes[:'rebate_qualified'] end if attributes.has_key?(:'rebate_achieved') self.rebate_achieved = attributes[:'rebate_achieved'] end if attributes.has_key?(:'financials') self.financials = attributes[:'financials'] end if attributes.has_key?(:'promotion_discount') self.promotion_discount = attributes[:'promotion_discount'] end if attributes.has_key?(:'promotion_present') self.promotion_present = attributes[:'promotion_present'] end if attributes.has_key?(:'remaining_refund_amount') self.remaining_refund_amount = attributes[:'remaining_refund_amount'] end if attributes.has_key?(:'refund_total') self.refund_total = attributes[:'refund_total'] end if attributes.has_key?(:'extra_refund_amount') self.extra_refund_amount = attributes[:'extra_refund_amount'] end if attributes.has_key?(:'user') self.user = attributes[:'user'] end if attributes.has_key?(:'delivery_address') self.delivery_address = attributes[:'delivery_address'] end if attributes.has_key?(:'delivery_zone') self.delivery_zone = attributes[:'delivery_zone'] end if attributes.has_key?(:'delivery_service') self.delivery_service = attributes[:'delivery_service'] end if attributes.has_key?(:'order_detail') self.order_detail = attributes[:'order_detail'] end if attributes.has_key?(:'order_total') self.order_total = attributes[:'order_total'] end if attributes.has_key?(:'delivery_total') self.delivery_total = attributes[:'delivery_total'] end if attributes.has_key?(:'enquiry') self.enquiry = attributes[:'enquiry'] end if attributes.has_key?(:'items') if (value = attributes[:'items']).is_a?(Array) self.items = value end end if attributes.has_key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end end if attributes.has_key?(:'updated_at') self.updated_at = attributes[:'updated_at'] end end |
Instance Attribute Details
#accepted_at ⇒ Object
Returns the value of attribute accepted_at.
22 23 24 |
# File 'lib/noths/models/order.rb', line 22 def accepted_at @accepted_at end |
#archived_at ⇒ Object
Returns the value of attribute archived_at.
26 27 28 |
# File 'lib/noths/models/order.rb', line 26 def archived_at @archived_at end |
#confirm_by ⇒ Object
Returns the value of attribute confirm_by.
12 13 14 |
# File 'lib/noths/models/order.rb', line 12 def confirm_by @confirm_by end |
#customer_expected_delivery_date ⇒ Object
Returns the value of attribute customer_expected_delivery_date.
30 31 32 |
# File 'lib/noths/models/order.rb', line 30 def customer_expected_delivery_date @customer_expected_delivery_date end |
#declined_at ⇒ Object
Returns the value of attribute declined_at.
20 21 22 |
# File 'lib/noths/models/order.rb', line 20 def declined_at @declined_at end |
#delivery_address ⇒ Object
Returns the value of attribute delivery_address.
84 85 86 |
# File 'lib/noths/models/order.rb', line 84 def delivery_address @delivery_address end |
#delivery_note ⇒ Object
Returns the value of attribute delivery_note.
58 59 60 |
# File 'lib/noths/models/order.rb', line 58 def delivery_note @delivery_note end |
#delivery_recipient_first_name ⇒ Object
Returns the value of attribute delivery_recipient_first_name.
42 43 44 |
# File 'lib/noths/models/order.rb', line 42 def delivery_recipient_first_name @delivery_recipient_first_name end |
#delivery_recipient_last_name ⇒ Object
Returns the value of attribute delivery_recipient_last_name.
44 45 46 |
# File 'lib/noths/models/order.rb', line 44 def delivery_recipient_last_name @delivery_recipient_last_name end |
#delivery_recipient_name ⇒ Object
Returns the value of attribute delivery_recipient_name.
40 41 42 |
# File 'lib/noths/models/order.rb', line 40 def delivery_recipient_name @delivery_recipient_name end |
#delivery_service ⇒ Object
Returns the value of attribute delivery_service.
88 89 90 |
# File 'lib/noths/models/order.rb', line 88 def delivery_service @delivery_service end |
#delivery_total ⇒ Object
Returns the value of attribute delivery_total.
94 95 96 |
# File 'lib/noths/models/order.rb', line 94 def delivery_total @delivery_total end |
#delivery_zone ⇒ Object
Returns the value of attribute delivery_zone.
86 87 88 |
# File 'lib/noths/models/order.rb', line 86 def delivery_zone @delivery_zone end |
#dispatch_note_viewed ⇒ Object
Returns the value of attribute dispatch_note_viewed.
34 35 36 |
# File 'lib/noths/models/order.rb', line 34 def dispatch_note_viewed @dispatch_note_viewed end |
#dispatch_overdue ⇒ Object
Returns the value of attribute dispatch_overdue.
48 49 50 |
# File 'lib/noths/models/order.rb', line 48 def dispatch_overdue @dispatch_overdue end |
#dispatched_at ⇒ Object
Returns the value of attribute dispatched_at.
24 25 26 |
# File 'lib/noths/models/order.rb', line 24 def dispatched_at @dispatched_at end |
#enquiry ⇒ Object
Returns the value of attribute enquiry.
96 97 98 |
# File 'lib/noths/models/order.rb', line 96 def enquiry @enquiry end |
#estimated_delivery_date ⇒ Object
Returns the value of attribute estimated_delivery_date.
62 63 64 |
# File 'lib/noths/models/order.rb', line 62 def estimated_delivery_date @estimated_delivery_date end |
#estimated_dispatch_at ⇒ Object
Returns the value of attribute estimated_dispatch_at.
14 15 16 |
# File 'lib/noths/models/order.rb', line 14 def estimated_dispatch_at @estimated_dispatch_at end |
#expired_at ⇒ Object
Returns the value of attribute expired_at.
18 19 20 |
# File 'lib/noths/models/order.rb', line 18 def expired_at @expired_at end |
#express ⇒ Object
Returns the value of attribute express.
36 37 38 |
# File 'lib/noths/models/order.rb', line 36 def express @express end |
#extra_refund_amount ⇒ Object
Returns the value of attribute extra_refund_amount.
80 81 82 |
# File 'lib/noths/models/order.rb', line 80 def extra_refund_amount @extra_refund_amount end |
#financials ⇒ Object
Returns the value of attribute financials.
70 71 72 |
# File 'lib/noths/models/order.rb', line 70 def financials @financials end |
#gift ⇒ Object
Returns the value of attribute gift.
50 51 52 |
# File 'lib/noths/models/order.rb', line 50 def gift @gift end |
#gift_message ⇒ Object
Returns the value of attribute gift_message.
52 53 54 |
# File 'lib/noths/models/order.rb', line 52 def @gift_message end |
#gift_receipt ⇒ Object
Returns the value of attribute gift_receipt.
56 57 58 |
# File 'lib/noths/models/order.rb', line 56 def gift_receipt @gift_receipt end |
#gift_wrap ⇒ Object
Returns the value of attribute gift_wrap.
54 55 56 |
# File 'lib/noths/models/order.rb', line 54 def gift_wrap @gift_wrap end |
#has_enquiry ⇒ Object
Returns the value of attribute has_enquiry.
60 61 62 |
# File 'lib/noths/models/order.rb', line 60 def has_enquiry @has_enquiry end |
#id ⇒ Object
Returns the value of attribute id.
8 9 10 |
# File 'lib/noths/models/order.rb', line 8 def id @id end |
#international ⇒ Object
Returns the value of attribute international.
46 47 48 |
# File 'lib/noths/models/order.rb', line 46 def international @international end |
#items ⇒ Object
Returns the value of attribute items.
98 99 100 |
# File 'lib/noths/models/order.rb', line 98 def items @items end |
#links ⇒ Object
Returns the value of attribute links.
100 101 102 |
# File 'lib/noths/models/order.rb', line 100 def links @links end |
#number ⇒ Object
Returns the value of attribute number.
32 33 34 |
# File 'lib/noths/models/order.rb', line 32 def number @number end |
#order_detail ⇒ Object
Returns the value of attribute order_detail.
90 91 92 |
# File 'lib/noths/models/order.rb', line 90 def order_detail @order_detail end |
#order_total ⇒ Object
Returns the value of attribute order_total.
92 93 94 |
# File 'lib/noths/models/order.rb', line 92 def order_total @order_total end |
#partner_name ⇒ Object
Returns the value of attribute partner_name.
38 39 40 |
# File 'lib/noths/models/order.rb', line 38 def partner_name @partner_name end |
#placed_at ⇒ Object
Returns the value of attribute placed_at.
16 17 18 |
# File 'lib/noths/models/order.rb', line 16 def placed_at @placed_at end |
#promotion_discount ⇒ Object
Returns the value of attribute promotion_discount.
72 73 74 |
# File 'lib/noths/models/order.rb', line 72 def promotion_discount @promotion_discount end |
#promotion_present ⇒ Object
Returns the value of attribute promotion_present.
74 75 76 |
# File 'lib/noths/models/order.rb', line 74 def promotion_present @promotion_present end |
#rebate_achieved ⇒ Object
null in sites where rebates are not offered
68 69 70 |
# File 'lib/noths/models/order.rb', line 68 def rebate_achieved @rebate_achieved end |
#rebate_qualified ⇒ Object
null in sites where rebates are not offered
65 66 67 |
# File 'lib/noths/models/order.rb', line 65 def rebate_qualified @rebate_qualified end |
#refund_total ⇒ Object
Returns the value of attribute refund_total.
78 79 80 |
# File 'lib/noths/models/order.rb', line 78 def refund_total @refund_total end |
#remaining_refund_amount ⇒ Object
Returns the value of attribute remaining_refund_amount.
76 77 78 |
# File 'lib/noths/models/order.rb', line 76 def remaining_refund_amount @remaining_refund_amount end |
#repeat_customer ⇒ Object
Returns the value of attribute repeat_customer.
28 29 30 |
# File 'lib/noths/models/order.rb', line 28 def repeat_customer @repeat_customer end |
#state ⇒ Object
Returns the value of attribute state.
10 11 12 |
# File 'lib/noths/models/order.rb', line 10 def state @state end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
102 103 104 |
# File 'lib/noths/models/order.rb', line 102 def updated_at @updated_at end |
#user ⇒ Object
Returns the value of attribute user.
82 83 84 |
# File 'lib/noths/models/order.rb', line 82 def user @user end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/noths/models/order.rb', line 106 def self.attribute_map { :'id' => :'id', :'state' => :'state', :'confirm_by' => :'confirm_by', :'estimated_dispatch_at' => :'estimated_dispatch_at', :'placed_at' => :'placed_at', :'expired_at' => :'expired_at', :'declined_at' => :'declined_at', :'accepted_at' => :'accepted_at', :'dispatched_at' => :'dispatched_at', :'archived_at' => :'archived_at', :'repeat_customer' => :'repeat_customer', :'customer_expected_delivery_date' => :'customer_expected_delivery_date', :'number' => :'number', :'dispatch_note_viewed' => :'dispatch_note_viewed', :'express' => :'express', :'partner_name' => :'partner_name', :'delivery_recipient_name' => :'delivery_recipient_name', :'delivery_recipient_first_name' => :'delivery_recipient_first_name', :'delivery_recipient_last_name' => :'delivery_recipient_last_name', :'international' => :'international', :'dispatch_overdue' => :'dispatch_overdue', :'gift' => :'gift', :'gift_message' => :'gift_message', :'gift_wrap' => :'gift_wrap', :'gift_receipt' => :'gift_receipt', :'delivery_note' => :'delivery_note', :'has_enquiry' => :'has_enquiry', :'estimated_delivery_date' => :'estimated_delivery_date', :'rebate_qualified' => :'rebate_qualified', :'rebate_achieved' => :'rebate_achieved', :'financials' => :'financials', :'promotion_discount' => :'promotion_discount', :'promotion_present' => :'promotion_present', :'remaining_refund_amount' => :'remaining_refund_amount', :'refund_total' => :'refund_total', :'extra_refund_amount' => :'extra_refund_amount', :'user' => :'user', :'delivery_address' => :'delivery_address', :'delivery_zone' => :'delivery_zone', :'delivery_service' => :'delivery_service', :'order_detail' => :'order_detail', :'order_total' => :'order_total', :'delivery_total' => :'delivery_total', :'enquiry' => :'enquiry', :'items' => :'items', :'links' => :'links', :'updated_at' => :'updated_at' } end |
.swagger_types ⇒ Object
Attribute type mapping.
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/noths/models/order.rb', line 159 def self.swagger_types { :'id' => :'Integer', :'state' => :'String', :'confirm_by' => :'DateTime', :'estimated_dispatch_at' => :'DateTime', :'placed_at' => :'DateTime', :'expired_at' => :'DateTime', :'declined_at' => :'DateTime', :'accepted_at' => :'DateTime', :'dispatched_at' => :'DateTime', :'archived_at' => :'DateTime', :'repeat_customer' => :'BOOLEAN', :'customer_expected_delivery_date' => :'DateTime', :'number' => :'String', :'dispatch_note_viewed' => :'BOOLEAN', :'express' => :'BOOLEAN', :'partner_name' => :'String', :'delivery_recipient_name' => :'String', :'delivery_recipient_first_name' => :'String', :'delivery_recipient_last_name' => :'String', :'international' => :'BOOLEAN', :'dispatch_overdue' => :'BOOLEAN', :'gift' => :'BOOLEAN', :'gift_message' => :'String', :'gift_wrap' => :'BOOLEAN', :'gift_receipt' => :'BOOLEAN', :'delivery_note' => :'String', :'has_enquiry' => :'BOOLEAN', :'estimated_delivery_date' => :'DateTime', :'rebate_qualified' => :'BOOLEAN', :'rebate_achieved' => :'BOOLEAN', :'financials' => :'Financials', :'promotion_discount' => :'Integer', :'promotion_present' => :'BOOLEAN', :'remaining_refund_amount' => :'Money', :'refund_total' => :'Money', :'extra_refund_amount' => :'Money', :'user' => :'User', :'delivery_address' => :'DeliveryAddress', :'delivery_zone' => :'DeliveryZone', :'delivery_service' => :'DeliveryService', :'order_detail' => :'OrderDetail', :'order_total' => :'Money', :'delivery_total' => :'Money', :'enquiry' => :'Enquiry', :'items' => :'Array<Item>', :'links' => :'Array<Link>', :'updated_at' => :'DateTime' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 |
# File 'lib/noths/models/order.rb', line 643 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && state == o.state && confirm_by == o.confirm_by && estimated_dispatch_at == o.estimated_dispatch_at && placed_at == o.placed_at && expired_at == o.expired_at && declined_at == o.declined_at && accepted_at == o.accepted_at && dispatched_at == o.dispatched_at && archived_at == o.archived_at && repeat_customer == o.repeat_customer && customer_expected_delivery_date == o.customer_expected_delivery_date && number == o.number && dispatch_note_viewed == o.dispatch_note_viewed && express == o.express && partner_name == o.partner_name && delivery_recipient_name == o.delivery_recipient_name && delivery_recipient_first_name == o.delivery_recipient_first_name && delivery_recipient_last_name == o.delivery_recipient_last_name && international == o.international && dispatch_overdue == o.dispatch_overdue && gift == o.gift && == o. && gift_wrap == o.gift_wrap && gift_receipt == o.gift_receipt && delivery_note == o.delivery_note && has_enquiry == o.has_enquiry && estimated_delivery_date == o.estimated_delivery_date && rebate_qualified == o.rebate_qualified && rebate_achieved == o.rebate_achieved && financials == o.financials && promotion_discount == o.promotion_discount && promotion_present == o.promotion_present && remaining_refund_amount == o.remaining_refund_amount && refund_total == o.refund_total && extra_refund_amount == o.extra_refund_amount && user == o.user && delivery_address == o.delivery_address && delivery_zone == o.delivery_zone && delivery_service == o.delivery_service && order_detail == o.order_detail && order_total == o.order_total && delivery_total == o.delivery_total && enquiry == o.enquiry && items == o.items && links == o.links && updated_at == o.updated_at end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 |
# File 'lib/noths/models/order.rb', line 731 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = Noths.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
796 797 798 799 800 801 802 803 804 805 806 807 808 |
# File 'lib/noths/models/order.rb', line 796 def _to_hash(value) if value.is_a?(Array) value.compact.map{ |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 |
# File 'lib/noths/models/order.rb', line 710 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
697 698 699 |
# File 'lib/noths/models/order.rb', line 697 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
703 704 705 |
# File 'lib/noths/models/order.rb', line 703 def hash [id, state, confirm_by, estimated_dispatch_at, placed_at, expired_at, declined_at, accepted_at, dispatched_at, archived_at, repeat_customer, customer_expected_delivery_date, number, dispatch_note_viewed, express, partner_name, delivery_recipient_name, delivery_recipient_first_name, delivery_recipient_last_name, international, dispatch_overdue, gift, , gift_wrap, gift_receipt, delivery_note, has_enquiry, estimated_delivery_date, rebate_qualified, rebate_achieved, financials, promotion_discount, promotion_present, remaining_refund_amount, refund_total, extra_refund_amount, user, delivery_address, delivery_zone, delivery_service, order_detail, order_total, delivery_total, enquiry, items, links, updated_at].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 |
# File 'lib/noths/models/order.rb', line 415 def list_invalid_properties invalid_properties = Array.new if @id.nil? invalid_properties.push("invalid value for 'id', id cannot be nil.") end if @state.nil? invalid_properties.push("invalid value for 'state', state cannot be nil.") end if @confirm_by.nil? invalid_properties.push("invalid value for 'confirm_by', confirm_by cannot be nil.") end if @estimated_dispatch_at.nil? invalid_properties.push("invalid value for 'estimated_dispatch_at', estimated_dispatch_at cannot be nil.") end if @placed_at.nil? invalid_properties.push("invalid value for 'placed_at', placed_at cannot be nil.") end if @expired_at.nil? invalid_properties.push("invalid value for 'expired_at', expired_at cannot be nil.") end if @declined_at.nil? invalid_properties.push("invalid value for 'declined_at', declined_at cannot be nil.") end if @accepted_at.nil? invalid_properties.push("invalid value for 'accepted_at', accepted_at cannot be nil.") end if @dispatched_at.nil? invalid_properties.push("invalid value for 'dispatched_at', dispatched_at cannot be nil.") end if @repeat_customer.nil? invalid_properties.push("invalid value for 'repeat_customer', repeat_customer cannot be nil.") end if @customer_expected_delivery_date.nil? invalid_properties.push("invalid value for 'customer_expected_delivery_date', customer_expected_delivery_date cannot be nil.") end if @number.nil? invalid_properties.push("invalid value for 'number', number cannot be nil.") end if @dispatch_note_viewed.nil? invalid_properties.push("invalid value for 'dispatch_note_viewed', dispatch_note_viewed cannot be nil.") end if @express.nil? invalid_properties.push("invalid value for 'express', express cannot be nil.") end if @partner_name.nil? invalid_properties.push("invalid value for 'partner_name', partner_name cannot be nil.") end if @delivery_recipient_name.nil? invalid_properties.push("invalid value for 'delivery_recipient_name', delivery_recipient_name cannot be nil.") end if @delivery_recipient_first_name.nil? invalid_properties.push("invalid value for 'delivery_recipient_first_name', delivery_recipient_first_name cannot be nil.") end if @delivery_recipient_last_name.nil? invalid_properties.push("invalid value for 'delivery_recipient_last_name', delivery_recipient_last_name cannot be nil.") end if @international.nil? invalid_properties.push("invalid value for 'international', international cannot be nil.") end if @dispatch_overdue.nil? invalid_properties.push("invalid value for 'dispatch_overdue', dispatch_overdue cannot be nil.") end if @gift.nil? invalid_properties.push("invalid value for 'gift', gift cannot be nil.") end if @gift_message.nil? invalid_properties.push("invalid value for 'gift_message', gift_message cannot be nil.") end if @gift_wrap.nil? invalid_properties.push("invalid value for 'gift_wrap', gift_wrap cannot be nil.") end if @gift_receipt.nil? invalid_properties.push("invalid value for 'gift_receipt', gift_receipt cannot be nil.") end if @delivery_note.nil? invalid_properties.push("invalid value for 'delivery_note', delivery_note cannot be nil.") end if @has_enquiry.nil? invalid_properties.push("invalid value for 'has_enquiry', has_enquiry cannot be nil.") end if @estimated_delivery_date.nil? invalid_properties.push("invalid value for 'estimated_delivery_date', estimated_delivery_date cannot be nil.") end if @financials.nil? invalid_properties.push("invalid value for 'financials', financials cannot be nil.") end if @promotion_discount.nil? invalid_properties.push("invalid value for 'promotion_discount', promotion_discount cannot be nil.") end if @promotion_present.nil? invalid_properties.push("invalid value for 'promotion_present', promotion_present cannot be nil.") end if @remaining_refund_amount.nil? invalid_properties.push("invalid value for 'remaining_refund_amount', remaining_refund_amount cannot be nil.") end if @refund_total.nil? invalid_properties.push("invalid value for 'refund_total', refund_total cannot be nil.") end if @extra_refund_amount.nil? invalid_properties.push("invalid value for 'extra_refund_amount', extra_refund_amount cannot be nil.") end if @user.nil? invalid_properties.push("invalid value for 'user', user cannot be nil.") end if @delivery_address.nil? invalid_properties.push("invalid value for 'delivery_address', delivery_address cannot be nil.") end if @delivery_zone.nil? invalid_properties.push("invalid value for 'delivery_zone', delivery_zone cannot be nil.") end if @delivery_service.nil? invalid_properties.push("invalid value for 'delivery_service', delivery_service cannot be nil.") end if @order_detail.nil? invalid_properties.push("invalid value for 'order_detail', order_detail cannot be nil.") end if @order_total.nil? invalid_properties.push("invalid value for 'order_total', order_total cannot be nil.") end if @delivery_total.nil? invalid_properties.push("invalid value for 'delivery_total', delivery_total cannot be nil.") end if @enquiry.nil? invalid_properties.push("invalid value for 'enquiry', enquiry cannot be nil.") end if @items.nil? invalid_properties.push("invalid value for 'items', items cannot be nil.") end if @links.nil? invalid_properties.push("invalid value for 'links', links cannot be nil.") end return invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
777 778 779 |
# File 'lib/noths/models/order.rb', line 777 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
783 784 785 786 787 788 789 790 |
# File 'lib/noths/models/order.rb', line 783 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
771 772 773 |
# File 'lib/noths/models/order.rb', line 771 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 |
# File 'lib/noths/models/order.rb', line 594 def valid? return false if @id.nil? return false if @state.nil? return false if @confirm_by.nil? return false if @estimated_dispatch_at.nil? return false if @placed_at.nil? return false if @expired_at.nil? return false if @declined_at.nil? return false if @accepted_at.nil? return false if @dispatched_at.nil? return false if @repeat_customer.nil? return false if @customer_expected_delivery_date.nil? return false if @number.nil? return false if @dispatch_note_viewed.nil? return false if @express.nil? return false if @partner_name.nil? return false if @delivery_recipient_name.nil? return false if @delivery_recipient_first_name.nil? return false if @delivery_recipient_last_name.nil? return false if @international.nil? return false if @dispatch_overdue.nil? return false if @gift.nil? return false if @gift_message.nil? return false if @gift_wrap.nil? return false if @gift_receipt.nil? return false if @delivery_note.nil? return false if @has_enquiry.nil? return false if @estimated_delivery_date.nil? return false if @financials.nil? return false if @promotion_discount.nil? return false if @promotion_present.nil? return false if @remaining_refund_amount.nil? return false if @refund_total.nil? return false if @extra_refund_amount.nil? return false if @user.nil? return false if @delivery_address.nil? return false if @delivery_zone.nil? return false if @delivery_service.nil? return false if @order_detail.nil? return false if @order_total.nil? return false if @delivery_total.nil? return false if @enquiry.nil? return false if @items.nil? return false if @links.nil? return true end |