Sha256: 123c86d2c3f025d456bceb5280e3eabb238e7bcedb02177680411b93e77ff51d

Contents?: true

Size: 474 Bytes

Versions: 1

Compression:

Stored size: 474 Bytes

Contents

# Represents a single callback. Contains knowledge of the callback name and object
# and contains a method for calling the callback.

module Flirt
    class Callback
        attr_accessor :object, :callback_name
        def initialize(opts = {})
            self.callback_name = opts.fetch(:callback_name)
            self.object        = opts.fetch(:object)
        end

        def call(event_data)
            object.send callback_name, event_data
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flirt-0.0.1 lib/flirt/callback.rb