Class: SolidusEasypost::ReturnAuthorization

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
app/models/solidus_easypost/return_authorization.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(return_authorization) ⇒ ReturnAuthorization

Returns a new instance of ReturnAuthorization.



13
14
15
# File 'app/models/solidus_easypost/return_authorization.rb', line 13

def initialize(return_authorization)
  @return_authorization = return_authorization
end

Instance Attribute Details

#return_authorizationObject (readonly)

Returns the value of attribute return_authorization.



9
10
11
# File 'app/models/solidus_easypost/return_authorization.rb', line 9

def return_authorization
  @return_authorization
end

Instance Method Details

#easypost_shipmentObject



17
18
19
# File 'app/models/solidus_easypost/return_authorization.rb', line 17

def easypost_shipment
  @easypost_shipment ||= ShipmentBuilder.from_return_authorization(self)
end

#return_label(rate) ⇒ Object



21
22
23
24
25
# File 'app/models/solidus_easypost/return_authorization.rb', line 21

def return_label(rate)
  easypost_shipment.buy(rate) unless easypost_shipment.postage_label

  easypost_shipment.postage_label
end