Module: Connect::DSL

Included in:
Client, Service
Defined in:
lib/connect/dsl.rb

Instance Method Summary collapse

Instance Method Details

#on_rpc_method_added(method) ⇒ Object



29
30
# File 'lib/connect/dsl.rb', line 29

def on_rpc_method_added(method)
end

#rpc(name, request, response, ruby_method: nil) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/connect/dsl.rb', line 13

def rpc(name, request, response, ruby_method: nil)
  method = Method.new(
    name: name.to_sym,
    request_type: wrap_message_type(request),
    response_type: wrap_message_type(response),
    ruby_method: ruby_method&.to_sym || underscore(name).to_sym,
  )
  rpcs[name] = method

  on_rpc_method_added(method)
end

#rpcsObject



25
26
27
# File 'lib/connect/dsl.rb', line 25

def rpcs
  @rpcs ||= {}
end

#serviceObject



5
6
7
# File 'lib/connect/dsl.rb', line 5

def service
  @service
end

#service=(service) ⇒ Object



9
10
11
# File 'lib/connect/dsl.rb', line 9

def service=(service)
  @service = service
end