Class: FedexShip::GroundManifest
- Inherits:
-
Object
- Object
- FedexShip::GroundManifest
- Defined in:
- lib/fedex_ship/ground_manifest.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#manifest_data ⇒ Object
readonly
Returns the value of attribute manifest_data.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ GroundManifest
constructor
Initialize FedexShip::GroundManifest Object.
- #save ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ GroundManifest
Initialize FedexShip::GroundManifest Object
10 11 12 13 14 15 |
# File 'lib/fedex_ship/ground_manifest.rb', line 10 def initialize( = {}) puts @filename = [:filename] @manifest_data = Base64.decode64([:manifest][:file]) save end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
6 7 8 |
# File 'lib/fedex_ship/ground_manifest.rb', line 6 def filename @filename end |
#manifest_data ⇒ Object (readonly)
Returns the value of attribute manifest_data.
6 7 8 |
# File 'lib/fedex_ship/ground_manifest.rb', line 6 def manifest_data @manifest_data end |
Instance Method Details
#save ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/fedex_ship/ground_manifest.rb', line 17 def save return if manifest_data.nil? || filename.nil? full_path = Pathname.new(filename) File.open(full_path, 'wb') do |f| f.write(manifest_data) end end |