Module: Inspec::ProfileContext::DomainSpecificLunacy
- Defined in:
- lib/inspec/profile_context.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.create_dsl(profile_context) ⇒ Object
227 228 229 230 231 232 |
# File 'lib/inspec/profile_context.rb', line 227 def self.create_dsl(profile_context) Module.new do include DomainSpecificLunacy add_methods(profile_context) end end |
.included(mod) ⇒ Object
234 235 236 |
# File 'lib/inspec/profile_context.rb', line 234 def self.included(mod) mod.extend ClassMethods end |
Instance Method Details
#resource_class(profile_name, resource_name) ⇒ Object
238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/inspec/profile_context.rb', line 238 def resource_class(profile_name, resource_name) inner_context = if profile_name == profile_context.profile_id profile_context else profile_context.subcontext_by_name(profile_name) end raise ProfileNotFound, "Cannot find profile named: #{profile_name}" if inner_context.nil? inner_context.resource_registry[resource_name] end |