Class: QRPC::Protocol::Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/qrpc/protocol/abstract.rb,
lib/qrpc/protocol/abstract/error.rb,
lib/qrpc/protocol/abstract/object.rb,
lib/qrpc/protocol/abstract/request.rb,
lib/qrpc/protocol/abstract/response.rb

Overview

Abstract protocol implementation.

Since:

  • 0.9.0

Direct Known Subclasses

JsonRpc, Object

Defined Under Namespace

Classes: Error, Object, Request, Response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = { }) ⇒ Abstract

This method is abstract.

Constructor.

Parameters:

  • options (Hash) (defaults to: { })

    general options for submodules

Since:

  • 0.9.0



53
54
55
56
57
58
59
60
# File 'lib/qrpc/protocol/abstract.rb', line 53

def initialize(options = { })
    @options = Hashie::Mash::new(options)
    @module_cache = { }
    
    if self.instance_of? Abstract
        not_implemented
    end
end

Instance Attribute Details

#optionsHashie::Mash

Holds general object options.

Returns:

  • (Hashie::Mash)

    general options

Since:

  • 0.9.0



37
38
39
# File 'lib/qrpc/protocol/abstract.rb', line 37

def options
  @options
end

Instance Method Details

#errorClass

Returns new error object.

Returns:

  • (Class)

    class of the error object

Since:

  • 0.9.0



85
86
87
# File 'lib/qrpc/protocol/abstract.rb', line 85

def error
    __module(:Error)
end

#requestClass

Returns new request object.

Returns:

  • (Class)

    class of the request object

Since:

  • 0.9.0



67
68
69
# File 'lib/qrpc/protocol/abstract.rb', line 67

def request
    __module(:Request)
end

#responseClass

Returns new response object.

Returns:

  • (Class)

    class of the response object

Since:

  • 0.9.0



76
77
78
# File 'lib/qrpc/protocol/abstract.rb', line 76

def response
    __module(:Response)
end