Sha256: 4812e2b1774f93e99315f39feb031e5fd737b15acdaf0c8ff3b280e5a8223040
Contents?: true
Size: 869 Bytes
Versions: 3
Compression:
Stored size: 869 Bytes
Contents
# frozen_string_literal: true module Wamp # WAMPApp class App def initialize @procedures = {} end def include_app(app, prefix = "") if prefix&.length&.zero? procedures.merge!(app.procedures) else app.procedures.each do |procedure, func| procedures.merge!({ "#{prefix}#{procedure}" => func }) end end end def procedures return {} if self.class.procedures && self.class.procedures.empty? return @procedures if @procedures.any? self.class.procedures.map do |procedure, registration_name| @procedures[registration_name.to_s] = method(procedure) end @procedures end class << self attr_reader :procedures def register(procedures = {}) @procedures ||= {} @procedures.merge!(procedures) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
xconn-0.1.2 | lib/wamp/app.rb |
xconn-0.1.1 | lib/wamp/app.rb |
xconn-0.1.0 | lib/wamp/app.rb |