Class: Inspec::Resources::Http::Worker::Remote
- Inherits:
-
Base
- Object
- Base
- Inspec::Resources::Http::Worker::Remote
show all
- Defined in:
- lib/resources/http.rb
Instance Attribute Summary collapse
Attributes inherited from Base
#http_method, #opts, #url
Instance Method Summary
collapse
Constructor Details
#initialize(inspec, http_method, url, opts) ⇒ Remote
Returns a new instance of Remote.
150
151
152
153
154
155
156
157
158
159
|
# File 'lib/resources/http.rb', line 150
def initialize(inspec, http_method, url, opts)
unless inspec.command('curl').exist?
raise Inspec::Exceptions::ResourceSkipped,
'curl is not available on the target machine'
end
@ran_curl = false
@inspec = inspec
super(http_method, url, opts)
end
|
Instance Attribute Details
#inspec ⇒ Object
Returns the value of attribute inspec.
148
149
150
|
# File 'lib/resources/http.rb', line 148
def inspec
@inspec
end
|
Instance Method Details
#body ⇒ Object
166
167
168
169
|
# File 'lib/resources/http.rb', line 166
def body
run_curl
@body&.strip
end
|
171
172
173
174
|
# File 'lib/resources/http.rb', line 171
def
run_curl
@response_headers
end
|
#status ⇒ Object
161
162
163
164
|
# File 'lib/resources/http.rb', line 161
def status
run_curl
@status
end
|