Module: PuppetStrings::Markdown::PuppetPlans

Defined in:
lib/puppet-strings/markdown/puppet_plans.rb

Class Method Summary collapse

Class Method Details

.contains_private?Boolean

Returns:

  • (Boolean)


12
13
14
15
16
17
# File 'lib/puppet-strings/markdown/puppet_plans.rb', line 12

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

.in_plansArray

Returns list of classes.

Returns:

  • (Array)

    list of classes



7
8
9
10
# File 'lib/puppet-strings/markdown/puppet_plans.rb', line 7

def self.in_plans
  arr = YARD::Registry.all(:puppet_plan).sort_by!(&:name).map!(&:to_hash)
  arr.map! { |a| PuppetStrings::Markdown::PuppetPlan.new(a) }
end

.renderObject



19
20
21
22
23
24
25
# File 'lib/puppet-strings/markdown/puppet_plans.rb', line 19

def self.render
  final = in_plans.length > 0 ? "## Plans\n\n" : ""
  in_plans.each do |plan|
    final << plan.render unless plan.private?
  end
  final
end

.toc_infoObject



27
28
29
30
31
32
33
34
35
# File 'lib/puppet-strings/markdown/puppet_plans.rb', line 27

def self.toc_info
  final = ["Plans"]

  in_plans.each do |plan|
    final.push(plan.toc_info)
  end

  final
end