Module: PuppetStrings::Markdown::DataTypes
- Defined in:
- lib/puppet-strings/markdown/data_types.rb
Class Method Summary collapse
- .contains_private? ⇒ Boolean
-
.in_dtypes ⇒ Array
List of data types.
- .render ⇒ Object
- .toc_info ⇒ Object
Class Method Details
.contains_private? ⇒ Boolean
17 18 19 20 21 22 |
# File 'lib/puppet-strings/markdown/data_types.rb', line 17 def self.contains_private? result = false unless in_dtypes.nil? in_dtypes.find { |type| type.private? }.nil? ? false : true end end |
.in_dtypes ⇒ Array
Returns list of data types.
9 10 11 12 13 14 15 |
# File 'lib/puppet-strings/markdown/data_types.rb', line 9 def self.in_dtypes arr = YARD::Registry.all(:puppet_data_type).map!(&:to_hash) arr.concat(YARD::Registry.all(:puppet_data_type_alias).map!(&:to_hash)) arr.sort! { |a,b| a[:name] <=> b[:name] } arr.map! { |a| PuppetStrings::Markdown::DataType.new(a) } end |
.render ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/puppet-strings/markdown/data_types.rb', line 24 def self.render final = in_dtypes.length > 0 ? "## Data types\n\n" : "" in_dtypes.each do |type| final += type.render unless type.private? end final end |
.toc_info ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/puppet-strings/markdown/data_types.rb', line 33 def self.toc_info final = ["Data types"] in_dtypes.each do |type| final.push(type.toc_info) end final end |