Class: PuppetStrings::Markdown::ResourceType
- Inherits:
-
Base
- Object
- Base
- PuppetStrings::Markdown::ResourceType
show all
- Defined in:
- lib/puppet-strings/markdown/resource_type.rb
Instance Method Summary
collapse
Methods inherited from Base
#defaults, #enums, #enums_for_param, #examples, #link, #name, #options, #options_for_param, #params, #private?, #raises, #return_type, #see, #since, #text, #toc_info, #value_string, #word_wrap
Constructor Details
Returns a new instance of ResourceType.
5
6
7
8
|
# File 'lib/puppet-strings/markdown/resource_type.rb', line 5
def initialize(registry)
@template = 'resource_type.erb'
super(registry, 'type')
end
|
Instance Method Details
#checks ⇒ Object
20
21
22
23
24
|
# File 'lib/puppet-strings/markdown/resource_type.rb', line 20
def checks
return nil unless @registry[:checks]
@registry[:checks].sort_by { |p| p[:name] }
end
|
#parameters ⇒ Object
33
34
35
36
37
|
# File 'lib/puppet-strings/markdown/resource_type.rb', line 33
def parameters
return nil unless @registry[:parameters]
@registry[:parameters].sort_by { |p| p[:name] }
end
|
#properties ⇒ Object
14
15
16
17
18
|
# File 'lib/puppet-strings/markdown/resource_type.rb', line 14
def properties
return nil unless @registry[:properties]
@registry[:properties].sort_by { |p| p[:name] }
end
|
#properties_and_checks ⇒ Object
“checks” (such as “onlyif” or “creates”) are another type of property
27
28
29
30
31
|
# File 'lib/puppet-strings/markdown/resource_type.rb', line 27
def properties_and_checks
return nil if properties.nil? && checks.nil?
((properties || []) + (checks || [])).sort_by { |p| p[:name] }
end
|
#regex_in_data_type?(data_type) ⇒ Boolean
39
40
41
42
|
# File 'lib/puppet-strings/markdown/resource_type.rb', line 39
def regex_in_data_type?(data_type)
m = data_type.match(/\w+\[\/.*\/\]/)
m unless m.nil? || m.length.zero?
end
|
#render ⇒ Object
10
11
12
|
# File 'lib/puppet-strings/markdown/resource_type.rb', line 10
def render
super(@template)
end
|