Class: Protod::Rpc::Response::Receiver::Base

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

Class Method Summary collapse

Class Method Details

.procedure_pushed?(name, singleton: false) ⇒ Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/protod/rpc/response.rb', line 61

def self.procedure_pushed?(name, singleton: false)
  procedures&.include?(Protod::RubyIdent.new(const_name: ruby_ident, method_name: name, singleton: singleton)) || false
end

.push_procedure(*names, singleton: false) ⇒ Object



52
53
54
55
56
57
58
59
# File 'lib/protod/rpc/response.rb', line 52

def self.push_procedure(*names, singleton: false)
  ruby_idents = names.map { Protod::RubyIdent.new(const_name: ruby_ident, method_name: _1, singleton: singleton) }

  Protod::Rpc::Response.register_for(*ruby_idents.map(&:to_s), with: Protod::Rpc::Response::Base, force: false, ignore: true)

  self.procedures ||= []
  self.procedures.push(*ruby_idents)
end