Class: RPC::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/rpc/lib/rpc.rb

Instance Method Summary collapse

Constructor Details

#initialize(subject, encoder = RPC::Encoders::Json::Server.new) ⇒ Server

Returns a new instance of Server.



42
43
44
# File 'lib/rpc/lib/rpc.rb', line 42

def initialize(subject, encoder = RPC::Encoders::Json::Server.new)
  @subject, @encoder = subject, encoder
end

Instance Method Details

#execute(encoded_command) ⇒ Object



46
47
48
# File 'lib/rpc/lib/rpc.rb', line 46

def execute(encoded_command)
  @encoder.execute(encoded_command, @subject)
end