Sha256: 9abba0158061ebd17d3ce2d0785e7a6f2fdd8eec8aad6502d3ed622df37e4f5b

Contents?: true

Size: 560 Bytes

Versions: 9

Compression:

Stored size: 560 Bytes

Contents

module ThreeScaleToolbox
  module Commands
    module PlansCommand
      module Export
        class ReadPlanPricingRulesStep
          include Step
          ##
          # Reads Application Plan pricing rules
          # add metric system_name out of metric_id
          def call
            result[:pricingrules] = plan.pricing_rules.map do |pr|
              pr.merge('metric' => metric_info(pr, 'PricingRule'),
                       'cost_per_unit' => pr.fetch('cost_per_unit').to_f)
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
3scale_toolbox-0.17.1 lib/3scale_toolbox/commands/plans_command/export/read_plan_pricing_rules_step.rb
3scale_toolbox-0.17.0 lib/3scale_toolbox/commands/plans_command/export/read_plan_pricing_rules_step.rb
3scale_toolbox-0.16.0 lib/3scale_toolbox/commands/plans_command/export/read_plan_pricing_rules_step.rb
3scale_toolbox-0.15.0 lib/3scale_toolbox/commands/plans_command/export/read_plan_pricing_rules_step.rb
3scale_toolbox-0.14.0 lib/3scale_toolbox/commands/plans_command/export/read_plan_pricing_rules_step.rb
3scale_toolbox-0.13.0 lib/3scale_toolbox/commands/plans_command/export/read_plan_pricing_rules_step.rb
3scale_toolbox-0.12.4 lib/3scale_toolbox/commands/plans_command/export/read_plan_pricing_rules_step.rb
3scale_toolbox-0.12.3 lib/3scale_toolbox/commands/plans_command/export/read_plan_pricing_rules_step.rb
3scale_toolbox-0.12.2 lib/3scale_toolbox/commands/plans_command/export/read_plan_pricing_rules_step.rb