Class: Spree::DeliveryProfiles::Digital

Inherits:
Spree::DeliveryProfile show all
Defined in:
app/models/spree/delivery_profiles/digital.rb

Overview

Digital goods: products in this profile are delivered digitally and checkout collects no shipping address. Only digital-provider methods may join, so the profile can never quietly reinterpret its products.

Instance Attribute Summary

Attributes inherited from Spree::DeliveryProfile

#products_count

Instance Method Summary collapse

Methods inherited from Spree::DeliveryProfile

#can_be_deleted?, #covers_location?, default_for, #default_origin_group, #fulfillable_stock_locations, #offers_pickup?, #offers_shipping?

Instance Method Details

#accepts_provider?(provider_class) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'app/models/spree/delivery_profiles/digital.rb', line 7

def accepts_provider?(provider_class)
  provider_class.digital?
end

#digital? ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'app/models/spree/delivery_profiles/digital.rb', line 11

def digital?
  true
end

#requires_shipping_address? ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'app/models/spree/delivery_profiles/digital.rb', line 15

def requires_shipping_address?
  false
end