mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
22 lines
376 B
Ruby
22 lines
376 B
Ruby
# frozen_string_literal: true
|
|
|
|
# A subscription added to the shopping cart
|
|
class CartItem::Subscription < CartItem::BaseItem
|
|
def initialize(plan)
|
|
raise TypeError unless plan.class == Plan
|
|
|
|
@plan = plan
|
|
end
|
|
|
|
def price
|
|
amount = @plan.amount
|
|
elements = { plan: amount }
|
|
|
|
{ elements: elements, amount: amount }
|
|
end
|
|
|
|
def name
|
|
@plan.name
|
|
end
|
|
end
|