Sha256: b21e33679d84024d7f1e01af7bf4830a4382f0a58df061f57de1d53ff044eb08

Contents?: true

Size: 720 Bytes

Versions: 4

Compression:

Stored size: 720 Bytes

Contents

# frozen_string_literal: true

require_relative 'puppet_task'

module PuppetStrings::Markdown
  module PuppetTasks

    # @return [Array] list of classes
    def self.in_tasks
      arr = YARD::Registry.all(:puppet_task).sort_by!(&:name).map!(&:to_hash)
      arr.map! { |a| PuppetStrings::Markdown::PuppetTask.new(a) }
    end

    def self.contains_private?
      false
    end

    def self.render
      final = in_tasks.length > 0 ? "## Tasks\n\n" : ""
      in_tasks.each do |task|
        final += task.render unless task.private?
      end
      final
    end

    def self.toc_info
      final = ["Tasks"]

      in_tasks.each do |task|
        final.push(task.toc_info)
      end

      final
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
puppet-strings-2.9.0 lib/puppet-strings/markdown/puppet_tasks.rb
puppet-strings-2.8.0 lib/puppet-strings/markdown/puppet_tasks.rb
puppet-strings-2.7.0 lib/puppet-strings/markdown/puppet_tasks.rb
puppet-strings-2.6.0 lib/puppet-strings/markdown/puppet_tasks.rb