Class: Cucumber::Formatter::IOHTTPBuffer
- Inherits:
-
Object
- Object
- Cucumber::Formatter::IOHTTPBuffer
- Defined in:
- lib/cucumber/formatter/http_io.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #close ⇒ Object
- #closed? ⇒ Boolean
- #flush ⇒ Object
-
#initialize(uri, method, headers = {}, https_verify_mode = nil) ⇒ IOHTTPBuffer
constructor
A new instance of IOHTTPBuffer.
- #write(data) ⇒ Object
Constructor Details
#initialize(uri, method, headers = {}, https_verify_mode = nil) ⇒ IOHTTPBuffer
Returns a new instance of IOHTTPBuffer.
67 68 69 70 71 72 73 |
# File 'lib/cucumber/formatter/http_io.rb', line 67 def initialize(uri, method, headers = {}, https_verify_mode = nil) @uri = URI(uri) @method = method @headers = headers @write_io = Tempfile.new('cucumber', encoding: 'UTF-8') @https_verify_mode = https_verify_mode end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
65 66 67 |
# File 'lib/cucumber/formatter/http_io.rb', line 65 def headers @headers end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
65 66 67 |
# File 'lib/cucumber/formatter/http_io.rb', line 65 def method @method end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
65 66 67 |
# File 'lib/cucumber/formatter/http_io.rb', line 65 def uri @uri end |
Instance Method Details
#close ⇒ Object
75 76 77 78 |
# File 'lib/cucumber/formatter/http_io.rb', line 75 def close post_content(@uri, @method, @headers) @write_io.close end |
#closed? ⇒ Boolean
88 89 90 |
# File 'lib/cucumber/formatter/http_io.rb', line 88 def closed? @write_io.closed? end |
#flush ⇒ Object
84 85 86 |
# File 'lib/cucumber/formatter/http_io.rb', line 84 def flush @write_io.flush end |
#write(data) ⇒ Object
80 81 82 |
# File 'lib/cucumber/formatter/http_io.rb', line 80 def write(data) @write_io.write(data) end |