Class: Shipvine::BillOfLading

Inherits:
Base
  • Object
show all
Defined in:
lib/shipvine/bill_of_lading.rb

Constant Summary

Constants inherited from Base

Shipvine::Base::WAREHOUSE_XSD_FILE

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Base

client, xml_to_hash

Instance Attribute Details

#formattedObject

Returns the value of attribute formatted.



4
5
6
# File 'lib/shipvine/bill_of_lading.rb', line 4

def formatted
  @formatted
end

#numericObject

Returns the value of attribute numeric.



4
5
6
# File 'lib/shipvine/bill_of_lading.rb', line 4

def numeric
  @numeric
end

Class Method Details

.generateObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/shipvine/bill_of_lading.rb', line 6

def self.generate
  response = self.client.request(
    :post,
    '/bol-numbers/' + Shipvine.merchant_code,
    ''
  )

  lading = self.new
  lading.formatted = response["BillOfLadingNumber"]["Formatted"]
  lading.numeric = response["BillOfLadingNumber"]["Numeric"]

  lading
end