Class: AbideDevUtils::CEM::Generate::Reference::Strings
- Inherits:
-
Object
- Object
- AbideDevUtils::CEM::Generate::Reference::Strings
- Defined in:
- lib/abide_dev_utils/cem/generate/reference.rb
Overview
Puppet Strings reference object
Constant Summary collapse
- REGISTRY_TYPES =
%i[ root module class puppet_class puppet_data_type puppet_data_type_alias puppet_defined_type puppet_type puppet_provider puppet_function puppet_task puppet_plan ].freeze
Instance Attribute Summary collapse
-
#search_patterns ⇒ Object
readonly
Returns the value of attribute search_patterns.
Instance Method Summary collapse
- #data_type_aliases ⇒ Object
- #data_types ⇒ Object
- #debug? ⇒ Boolean
- #defined_types ⇒ Object
- #find_resource(resource_name) ⇒ Object
-
#initialize(search_patterns: nil, opts: {}) ⇒ Strings
constructor
A new instance of Strings.
- #providers ⇒ Object
- #puppet_classes ⇒ Object
- #puppet_functions ⇒ Object
- #puppet_plans ⇒ Object
- #puppet_tasks ⇒ Object
- #quiet? ⇒ Boolean
- #registry ⇒ Object
- #resource_types ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(search_patterns: nil, opts: {}) ⇒ Strings
Returns a new instance of Strings.
124 125 126 127 128 129 130 |
# File 'lib/abide_dev_utils/cem/generate/reference.rb', line 124 def initialize(search_patterns: nil, opts: {}) @search_patterns = search_patterns || PuppetStrings::DEFAULT_SEARCH_PATTERNS @debug = opts[:debug] @quiet = opts[:quiet] PuppetStrings::Yard.setup! YARD::CLI::Yardoc.run(*yard_args(@search_patterns, debug: @debug, quiet: @quiet)) end |
Instance Attribute Details
#search_patterns ⇒ Object (readonly)
Returns the value of attribute search_patterns.
122 123 124 |
# File 'lib/abide_dev_utils/cem/generate/reference.rb', line 122 def search_patterns @search_patterns end |
Instance Method Details
#data_type_aliases ⇒ Object
159 160 161 |
# File 'lib/abide_dev_utils/cem/generate/reference.rb', line 159 def data_type_aliases @data_type_aliases ||= hashes_for_reg_type(:puppet_data_type_alias) end |
#data_types ⇒ Object
155 156 157 |
# File 'lib/abide_dev_utils/cem/generate/reference.rb', line 155 def data_types @data_types ||= hashes_for_reg_type(:puppet_data_types) end |
#debug? ⇒ Boolean
132 133 134 |
# File 'lib/abide_dev_utils/cem/generate/reference.rb', line 132 def debug? !!@debug end |
#defined_types ⇒ Object
163 164 165 |
# File 'lib/abide_dev_utils/cem/generate/reference.rb', line 163 def defined_types @defined_types ||= hashes_for_reg_type(:puppet_defined_type) end |
#find_resource(resource_name) ⇒ Object
144 145 146 147 148 149 |
# File 'lib/abide_dev_utils/cem/generate/reference.rb', line 144 def find_resource(resource_name) to_h.each do |_, resources| res = resources.find { |r| r[:name] == resource_name.to_sym } return res if res end end |
#providers ⇒ Object
171 172 173 |
# File 'lib/abide_dev_utils/cem/generate/reference.rb', line 171 def providers @providers ||= hashes_for_reg_type(:puppet_provider) end |
#puppet_classes ⇒ Object
151 152 153 |
# File 'lib/abide_dev_utils/cem/generate/reference.rb', line 151 def puppet_classes @puppet_classes ||= hashes_for_reg_type(:puppet_class) end |
#puppet_functions ⇒ Object
175 176 177 |
# File 'lib/abide_dev_utils/cem/generate/reference.rb', line 175 def puppet_functions @puppet_functions ||= hashes_for_reg_type(:puppet_function) end |
#puppet_plans ⇒ Object
183 184 185 |
# File 'lib/abide_dev_utils/cem/generate/reference.rb', line 183 def puppet_plans @puppet_plans ||= hashes_for_reg_type(:puppet_plan) end |
#puppet_tasks ⇒ Object
179 180 181 |
# File 'lib/abide_dev_utils/cem/generate/reference.rb', line 179 def puppet_tasks @puppet_tasks ||= hashes_for_reg_type(:puppet_task) end |
#quiet? ⇒ Boolean
136 137 138 |
# File 'lib/abide_dev_utils/cem/generate/reference.rb', line 136 def quiet? !!@quiet end |
#registry ⇒ Object
140 141 142 |
# File 'lib/abide_dev_utils/cem/generate/reference.rb', line 140 def registry @registry ||= YARD::Registry.all(*REGISTRY_TYPES) end |
#resource_types ⇒ Object
167 168 169 |
# File 'lib/abide_dev_utils/cem/generate/reference.rb', line 167 def resource_types @resource_types ||= hashes_for_reg_type(:puppet_type) end |
#to_h ⇒ Object
187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/abide_dev_utils/cem/generate/reference.rb', line 187 def to_h { puppet_classes: puppet_classes, data_types: data_types, data_type_aliases: data_type_aliases, defined_types: defined_types, resource_types: resource_types, providers: providers, puppet_functions: puppet_functions, puppet_tasks: puppet_tasks, puppet_plans: puppet_plans, } end |