Sha256: f084cdd782fa5f471061a1a1eb480c05125eeb563b9fc90f96573944468bdcb0
Contents?: true
Size: 1.26 KB
Versions: 4
Compression:
Stored size: 1.26 KB
Contents
module ThreeScaleToolbox module Commands module PlansCommand module Import class ImportMetricsStep include Step ## # Writes Plan metrics and methods def call missing_metrics.each(&method(:create_metric)) missing_methods.each(&method(:create_method)) end private def missing_metrics ThreeScaleToolbox::Helper.array_difference(resource_product_metrics, service.metrics) do |a, b| a['system_name'] == b.system_name end end def missing_methods ThreeScaleToolbox::Helper.array_difference(resource_product_methods, service.methods) do |a, b| a['system_name'] == b.system_name end end def create_metric(metric_attrs) metric = ThreeScaleToolbox::Entities::Metric.create(service: service, attrs: metric_attrs) puts "Created metric: #{metric.attrs['system_name']}" end def create_method(method_attrs) method = ThreeScaleToolbox::Entities::Method.create(service: service, attrs: method_attrs) puts "Created method: #{method.attrs['system_name']}" end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems