app/models/spree/ship_compliant.rb
# Note that this method can take either a Spree::StockLocation (which has address
# attributes directly on it) or a Spree::Address object
Note that this method can take either a Spree::StockLocation (which has address
attributes directly on it) or a Spree::Address object
Note that this method can take either a Spree :: StockLocation ( which has address attributes directly on it ) or a Spree :: Address object
def address_from_spree_address(address)
      ::ShipCompliant::Address.new(
        first_name: address.first_name,
        last_name:  address.last_name,
        country:    address.country.iso,
        city:       address.city,
        state:      address.try(:state).try(:abbr),
        street1:    address.address1,
        street2:    address.address2,
        zip1:       address.zipcode.try(:[], 0...5)).address
    end
def address_from_spree_address ( address ) :: ShipCompliant :: Address . new ( first_name : address . first_name , last_name : address . last_name , country : address . country . iso , city : address . city , state : address . try ( :state ) . try ( :abbr ) , street1 : address . address1 , street2 : address . address2 , zip1 : address . zipcode . try ( :[] , 0 ... 5 ) ) . address end
Note that this method can take either a Spree::StockLocation (which has address
attributes directly on it) or a Spree::Address object
Note that this method can take either a Spree :: StockLocation ( which has address attributes directly on it ) or a Spree :: Address object
address
<not_specific>