Class Hookout::ReverseHttpRequest
In: lib/hookout/reversehttp_connector.rb
Parent: Object

Methods

close   flush   makefile   new   write  

Attributes

body  [R] 
server_address  [R] 

Public Class methods

[Source]

# File lib/hookout/reversehttp_connector.rb, line 142
    def initialize(reply_url, server_address, body)
      @reply_url = reply_url
      @server_address = server_address
      @body = body
      @response_buffer = StringIO.new
      @closed = false
    end

Public Instance methods

[Source]

# File lib/hookout/reversehttp_connector.rb, line 165
    def close
      if not @closed
        @response_buffer.flush
        resp_body = @response_buffer.string

        Hookout::Utils.post_data @reply_url, resp_body
        @closed = true
      end
    end

[Source]

# File lib/hookout/reversehttp_connector.rb, line 162
    def flush
    end

[Source]

# File lib/hookout/reversehttp_connector.rb, line 150
    def makefile(mode, bufsize)
      if mode[0] == 'r':
        StringIO.new(@body)
      elsif mode[0] == 'w':
        self
      end
    end

[Source]

# File lib/hookout/reversehttp_connector.rb, line 158
    def write(x)
      @response_buffer.write(x)
    end

[Validate]