Class: Protobuf::Rpc::Connectors::Base

Inherits:
Object
  • Object
show all
Includes:
Logger::LogMethods
Defined in:
lib/protobuf/rpc/connectors/base.rb

Direct Known Subclasses

EventMachine, Socket

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Base

Returns a new instance of Base.



29
30
31
# File 'lib/protobuf/rpc/connectors/base.rb', line 29

def initialize(options)
  @options = DEFAULT_OPTIONS.merge(options)
end

Instance Attribute Details

#complete_cbObject

Returns the value of attribute complete_cb.



27
28
29
# File 'lib/protobuf/rpc/connectors/base.rb', line 27

def complete_cb
  @complete_cb
end

#failure_cbObject

Returns the value of attribute failure_cb.



27
28
29
# File 'lib/protobuf/rpc/connectors/base.rb', line 27

def failure_cb
  @failure_cb
end

#optionsObject (readonly)

Returns the value of attribute options.



26
27
28
# File 'lib/protobuf/rpc/connectors/base.rb', line 26

def options
  @options
end

#success_cbObject

Returns the value of attribute success_cb.



27
28
29
# File 'lib/protobuf/rpc/connectors/base.rb', line 27

def success_cb
  @success_cb
end

Instance Method Details

#async?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/protobuf/rpc/connectors/base.rb', line 37

def async?
  !!@options[:async]
end

#send_requestObject



33
34
35
# File 'lib/protobuf/rpc/connectors/base.rb', line 33

def send_request
  raise 'If you inherit a Connector from Base you must implement send_request'
end