class Object

Serialize objects to strings by default

Public Class Methods

from_msgpack(packed) click to toggle source
# File lib/msgpack_config.rb, line 9
def self.from_msgpack(packed)
  packed.unpack('A*').first
end

Public Instance Methods

all_instance_methods() click to toggle source
# File lib/pipe_rpc/_pipe_rpc.rb, line 14
def all_instance_methods
  private_methods = (respond_to? :private_instance_methods) ? private_instance_methods : []
  instance_methods + private_methods
end
const_get(constant_path, *args) click to toggle source
# File lib/pipe_rpc/_pipe_rpc.rb, line 22
def const_get(constant_path, *args)
  if constant_path.is_a? String
    constant_path.split('::').inject(self) do |mod, constant|
      mod.simple_const_get(constant.to_sym, *args)
    end
  else
    simple_const_get(constant_path, *args)
  end
end
dup_including(*methods) click to toggle source
# File lib/pipe_rpc/_pipe_rpc.rb, line 2
def dup_including(*methods)
  dup.class_eval do
    aliased = (methods.last.is_a? Hash) ? methods.last : {}
    aliased.each{ |from, to| alias_method to, from }

    to_be_kept_methods = methods + aliased.values
    (all_instance_methods - to_be_kept_methods).each{ |m| remove_method m }

    self
  end
end
to_msgpack(packer) click to toggle source
# File lib/msgpack_config.rb, line 5
def to_msgpack(packer)
  packer.pack(to_s)
end