Method: PlanFeatures::Pricing.all_plans

Defined in:
lib/plan_features/pricing.rb

.all_plansObject



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/plan_features/pricing.rb', line 28

def self.all_plans
  @all_plans ||= YAML.load_file(::PlanFeatures.configuration.plans_file_path).map do |plan, attributes|
    Pricing.new(
      plan_identifier: plan,
      name: attributes["name"],
      features: attributes["features"],
      prices: attributes["prices"],
      previous: attributes["previous"],
      metadata: attributes["metadata"]&.with_indifferent_access,
    )
  end
end