Sha256: f4affb3d9df47180614230b52f7d3fb004a873bad64a692b787ef578f88bac9d

Contents?: true

Size: 636 Bytes

Versions: 5

Compression:

Stored size: 636 Bytes

Contents

class IRC
  class Event
    attr_accessor :server, :sender, :command, :params

    def initialize(server, prefix, command, params)
      @server = server
      @sender = Sender.new(prefix)
      @command = command
      @params = params
    end


  end
end


module Kernel
 # Like instance_eval but allows parameters to be passed.
  def instance_exec(*args, &block)
    mname = "__instance_exec_#{Thread.current.object_id.abs}_#{object_id.abs}"
    Object.class_eval{ define_method(mname, &block) }
    begin
      ret = send(mname, *args)
    ensure
      Object.class_eval{ undef_method(mname) } rescue nil
    end
    ret
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
on_irc-2.1.5 lib/on_irc/event.rb
on_irc-2.1.4 lib/on_irc/event.rb
on_irc-2.1.3 lib/on_irc/event.rb
on_irc-2.1.1 lib/on_irc/event.rb
on_irc-2.1.0 lib/on_irc/event.rb