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

Version Path
smalruby-0.0.26-x86-mingw32 lib/smalruby/event_handler.rb
smalruby-0.0.26 lib/smalruby/event_handler.rb
smalruby-0.0.25-x86-mingw32 lib/smalruby/event_handler.rb
smalruby-0.0.25 lib/smalruby/event_handler.rb
smalruby-0.0.24-x86-mingw32 lib/smalruby/event_handler.rb
smalruby-0.0.24 lib/smalruby/event_handler.rb
smalruby-0.0.23-x86-mingw32 lib/smalruby/event_handler.rb
smalruby-0.0.23 lib/smalruby/event_handler.rb
smalruby-0.0.22-x86-mingw32 lib/smalruby/event_handler.rb
smalruby-0.0.22 lib/smalruby/event_handler.rb
smalruby-0.0.21-x86-mingw32 lib/smalruby/event_handler.rb
smalruby-0.0.21 lib/smalruby/event_handler.rb
smalruby-0.0.20-x86-mingw32 lib/smalruby/event_handler.rb
smalruby-0.0.20 lib/smalruby/event_handler.rb
smalruby-0.0.19-x86-mingw32 lib/smalruby/event_handler.rb
smalruby-0.0.19 lib/smalruby/event_handler.rb
smalruby-0.0.18-x86-mingw32 lib/smalruby/event_handler.rb
smalruby-0.0.18 lib/smalruby/event_handler.rb
smalruby-0.0.17-x86-mingw32 lib/smalruby/event_handler.rb
smalruby-0.0.17 lib/smalruby/event_handler.rb