Methods
Included Modules
- ActionView::Helpers::TextHelper
- ActionView::Context
Attributes
| [R] | errors | |
| [R] | member | |
| [R] | owner_view | |
| [R] | plan |
Class Public methods
new(plan:, member: nil, owner_view: false) Link
Source: show
# File app/services/service/plan_details.rb, line 8 def initialize(plan:, member: nil, owner_view: false) @plan = plan @member = member @owner_view = !!owner_view @errors = [] end
Instance Public methods
details() Link
Source: show
# File app/services/service/plan_details.rb, line 15 def details details = "" details += if plan.subscription_plan_type? && member.active_subscription details_for_replacing_active_subscription else pricing_description end expiration = expiration_description details += ", #{expiration}" if expiration details += " #{upcoming.coupon_message}" if plan.subscription_plan_type? add_owner_view(details).html_safe end
expiration_description() Link
Source: show
# File app/services/service/plan_details.rb, line 64 def expiration_description if plan.specific_time_expiration_type? specific_time_expiration_description elsif plan.interval_expiration_type? interval_expiration_description end end
pricing_description() Link
Source: show
# File app/services/service/plan_details.rb, line 32 def pricing_description text = "" if trial_duration > 0 text += "#{end_of_trial} " end if plan.subscription_plan_type? text += subscription_plan_description elsif plan.multi_payment_plan_type? text += payment_plan_description elsif plan.one_time_payment_plan_type? text += one_time_payment_plan_description elsif plan.free_plan_type? text += free_plan_description end if plan.signup_fee && !plan.trial? text += ", #{signup_fee_description}" end if plan.tax_percentage text += plan_tax_percentage_description end if billing_cycle_info? text += billing_cycle_info end text.html_safe end