Sha256: cd850611215e375494450368be68cc5f5925529e2339d53ec512cc357941a76f

Contents?: true

Size: 718 Bytes

Versions: 8

Compression:

Stored size: 718 Bytes

Contents

module Dox
  module Printers
    class ResourceGroupPrinter < BasePrinter
      def print(resource_group)
        self.resource_group = resource_group
        add_resource_group

        resource_group.resources.each do |_, resource|
          resource_printer.print(resource)
        end
      end

      private

      attr_accessor :resource_group

      def add_resource_group
        spec['x-tagGroups'].push(name: resource_group.name, 'tags' => []) unless group_included?
      end

      def group_included?
        spec['x-tagGroups'].find { |group| group[:name] == resource_group.name }
      end

      def resource_printer
        @resource_printer ||= ResourcePrinter.new(spec)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dox-2.4.0 lib/dox/printers/resource_group_printer.rb
dox-2.3.0 lib/dox/printers/resource_group_printer.rb
dox-2.2.0 lib/dox/printers/resource_group_printer.rb
dox-2.1.0 lib/dox/printers/resource_group_printer.rb
dox-2.0.0 lib/dox/printers/resource_group_printer.rb
dox-2.0.0.beta3 lib/dox/printers/resource_group_printer.rb
dox-2.0.0.beta2 lib/dox/printers/resource_group_printer.rb
dox-2.0.0.beta1 lib/dox/printers/resource_group_printer.rb