Sha256: 09e761178e0a93ea8ce3c223e3d64f31ee4c0d94faf1339aea1a123467e21248

Contents?: true

Size: 392 Bytes

Versions: 3

Compression:

Stored size: 392 Bytes

Contents

require 'miu/packet'

module Miu
  module Writable
    def self.included(base)
      base.class_eval do
        def write_with_packet(tag, message)
          packet = Packet.new tag, message
          write_without_packet *packet.dump
          packet
        end

        alias_method :write_without_packet, :write
        alias_method :write, :write_with_packet
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
miu-0.2.3 lib/miu/writable.rb
miu-0.2.2 lib/miu/writable.rb
miu-0.2.1 lib/miu/writable.rb