Class: Inspec::Resources::Opa

Inherits:
JsonConfig show all
Defined in:
lib/inspec/resources/opa.rb

Direct Known Subclasses

OpaApi, OpaCli

Instance Attribute Summary

Attributes inherited from JsonConfig

#params, #raw_content

Instance Method Summary collapse

Methods inherited from JsonConfig

#method_missing, #to_s, #value

Methods included from FileReader

#read_file_content

Methods included from ObjectTraverser

#extract_value

Constructor Details

#initialize(content) ⇒ Opa

Returns a new instance of Opa.



9
10
11
12
# File 'lib/inspec/resources/opa.rb', line 9

def initialize(content)
  @content = content
  super({ content: @content })
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Inspec::Resources::JsonConfig

Instance Method Details

#resultObject



14
15
16
# File 'lib/inspec/resources/opa.rb', line 14

def result
  @content == {} || @content["result"].empty? ? nil : @content
end