Sha256: 7f6eef3ea6b7a18bb847deb127573128cf1135354f5b92b2470d2b8568553f4e
Contents?: true
Size: 645 Bytes
Versions: 51
Compression:
Stored size: 645 Bytes
Contents
# -*- coding: utf-8 -*- module Smalruby # イベントハンドラを表現するクラス class EventHandler attr_accessor :object attr_accessor :options attr_accessor :block # @param [Object] object 操作対象 # @param [Array] options イベントハンドラのオプション # @param [Proc] block イベントハンドラ def initialize(object, options, &block) @object = object @options = options @block = block end def call(*args) return Thread.start(@object, @block) { |object, block| object.instance_exec(*args, &block) } end end end
Version data entries
51 entries across 51 versions & 1 rubygems