Class: PuppetStrings::Markdown::DataType

Inherits:
Base
  • Object
show all
Defined in:
lib/puppet-strings/markdown/data_type.rb

Overview

This class encapsualtes ruby data types and puppet type aliases

Defined Under Namespace

Classes: Function

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#defaults, #enums, #enums_for_param, #examples, group_name, items, #link, #name, #options, #options_for_param, #params, #private?, #raises, #return_type, #see, #since, #text, #toc_info, #word_wrap, yard_types

Methods included from Helpers

#code_maybe_block

Constructor Details

#initialize(registry) ⇒ DataType

Returns a new instance of DataType.



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

def initialize(registry)
  @template = 'data_type.erb'
  super(registry, 'data type')
  @alias_of = registry[:alias_of] unless registry[:alias_of].nil?
  @functions = @registry[:functions]&.map { |func| DataType::Function.new(func) }
end

Instance Attribute Details

#alias_ofObject (readonly)

Returns the value of attribute alias_of.



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

def alias_of
  @alias_of
end

#functionsObject (readonly)

Returns the value of attribute functions.



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

def functions
  @functions
end

Instance Method Details

#renderObject



20
21
22
# File 'lib/puppet-strings/markdown/data_type.rb', line 20

def render
  super(@template)
end