Class: SpreeBoxnow::PrintVouchers
- Inherits:
-
Object
- Object
- SpreeBoxnow::PrintVouchers
- Defined in:
- app/services/spree_boxnow/print_vouchers.rb
Defined Under Namespace
Classes: VoucherError
Instance Attribute Summary collapse
-
#parcel_id ⇒ Object
readonly
Returns the value of attribute parcel_id.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(parcel_id) ⇒ PrintVouchers
constructor
A new instance of PrintVouchers.
Constructor Details
#initialize(parcel_id) ⇒ PrintVouchers
Returns a new instance of PrintVouchers.
5 6 7 |
# File 'app/services/spree_boxnow/print_vouchers.rb', line 5 def initialize(parcel_id) @parcel_id = parcel_id end |
Instance Attribute Details
#parcel_id ⇒ Object (readonly)
Returns the value of attribute parcel_id.
3 4 5 |
# File 'app/services/spree_boxnow/print_vouchers.rb', line 3 def parcel_id @parcel_id end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 |
# File 'app/services/spree_boxnow/print_vouchers.rb', line 9 def call SpreeBoxnow::ApiClient.new.fetch_label(parcel_id, format: 'pdf') rescue SpreeBoxnow::ApiClient::ApiError => e raise VoucherError, e. end |