Sha256: 58a4728220af424aa22c1ff673e67c7268783e9e13c9bbb0a150ba018e3718f8

Contents?: true

Size: 839 Bytes

Versions: 9

Compression:

Stored size: 839 Bytes

Contents

require_relative 'resource_type'

module PuppetStrings::Markdown
  module ResourceTypes

    # @return [Array] list of resource types
    def self.in_rtypes
      arr = YARD::Registry.all(:puppet_type).sort_by!(&:name).map!(&:to_hash)
      arr.map! { |a| PuppetStrings::Markdown::ResourceType.new(a) }
    end

    def self.contains_private?
      result = false
      unless in_rtypes.nil?
        in_rtypes.find { |type| type.private? }.nil? ? false : true
      end
    end

    def self.render
      final = in_rtypes.length > 0 ? "## Resource types\n\n" : ""
      in_rtypes.each do |type|
        final << type.render unless type.private?
      end
      final
    end

    def self.toc_info
      final = ["Resource types"]

      in_rtypes.each do |type|
        final.push(type.toc_info)
      end

      final
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
puppet-strings-2.5.0 lib/puppet-strings/markdown/resource_types.rb
puppet-strings-2.4.0 lib/puppet-strings/markdown/resource_types.rb
puppet-strings-2.3.1 lib/puppet-strings/markdown/resource_types.rb
puppet-strings-2.3.0 lib/puppet-strings/markdown/resource_types.rb
puppet-strings-2.2.0 lib/puppet-strings/markdown/resource_types.rb
puppet-strings-2.1.0 lib/puppet-strings/markdown/resource_types.rb
puppet-strings-2.0.0 lib/puppet-strings/markdown/resource_types.rb
puppet-strings-1.2.1 lib/puppet-strings/markdown/resource_types.rb
puppet-strings-1.2.0 lib/puppet-strings/markdown/resource_types.rb