Sha256: 3ab1e2767ffb8cb84bd4cd3e0f9c539973346431ed128025d075bed738a5a9de

Contents?: true

Size: 1.6 KB

Versions: 1

Compression:

Stored size: 1.6 KB

Contents

=begin

    This file is part of the Arachni-RPC project and may be subject to
    redistribution and commercial restrictions. Please see the Arachni-RPC
    web site for more information on licensing and terms of use.

=end

require File.join( File.expand_path( File.dirname( __FILE__ ) ), 'message' )

module Arachni
module RPC

#
# Represents an RPC request.
#
# It's here only for formalization purposes,
# it's not actually sent over the wire.
#
# What is sent is a hash generated by {#prepare_for_tx}.
# which is in the form of:
#
#
#    {
#        'message'     => msg, # RPC message in the form of 'handler.method'
#        'args'        => args, # optional array of arguments for the remote method
#        'token'       => token, # optional authentication token
#    }
#
# Any client that has SSL support and can serialize a Hash
# just like the one above can communicate with the RPC server.
#
# @author: Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
#
class Request < Message

    #
    # RPC message in the form of 'handler.method'.
    #
    # @return   [String]
    #
    attr_accessor :message

    #
    # Optional array of arguments for the remote method.
    #
    # @return   [Array]
    #
    attr_accessor :args

    #
    # Optional authentication token.
    #
    # @return   [String]
    #
    attr_accessor :token

    #
    # Callback to be invoked on the response.
    #
    # @return   [Proc]
    #
    attr_accessor :callback

    # @see Message#initialize
    def initialize( * )
        super
    end

    private

    def transmit?( attr )
        ![ :@callback ].include?( attr )
    end

end

end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
arachni-rpc-0.1.3 lib/arachni/rpc/request.rb