Sha256: 0035d66a07e5c617d5149511eb4c23488635dab80c5d1d010825d7da7146b304

Contents?: true

Size: 534 Bytes

Versions: 6

Compression:

Stored size: 534 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.attrs.merge('metric' => metric_info(pr, 'PricingRule'), 'cost_per_unit' => pr.cost_per_unit.to_f)
            end
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
3scale_toolbox-0.19.2 lib/3scale_toolbox/commands/plans_command/export/read_plan_pricing_rules_step.rb
3scale_toolbox-0.19.1 lib/3scale_toolbox/commands/plans_command/export/read_plan_pricing_rules_step.rb
3scale_toolbox-0.19.0 lib/3scale_toolbox/commands/plans_command/export/read_plan_pricing_rules_step.rb
3scale_toolbox-0.18.3 lib/3scale_toolbox/commands/plans_command/export/read_plan_pricing_rules_step.rb
3scale_toolbox-0.18.2 lib/3scale_toolbox/commands/plans_command/export/read_plan_pricing_rules_step.rb
3scale_toolbox-0.18.0 lib/3scale_toolbox/commands/plans_command/export/read_plan_pricing_rules_step.rb