Sha256: 1f64ced543851ee9c3f330d7b7a69fcfba5a67aba5ecdc348478f9823ce2f7a4

Contents?: true

Size: 704 Bytes

Versions: 20

Compression:

Stored size: 704 Bytes

Contents

# Hook. Created by plugins, it's block is called if emitted event matches pattern
# @!attribute [r] pattern
#   @return [Hash<Symbol>] Hook's pattern
# @!attribute [r] block
#   @return [Proc] Block
# @!attribute [r] extra
#   @return [Hash] Extra data. Usually used by hook modifiers
# @!attribute [r] chain
#   @return [Array<Proc>] Proc array. These are executed before calling main block.
#     If any returns false value, main block is not called
class ProtonBot::Hook
  attr_reader :pattern, :block, :extra, :chain

  # @param pattern [Hash<Symbol>]
  # @param block [Proc]
  def initialize(pattern, &block)
    @pattern = pattern
    @block   = block
    @extra   = {}
    @chain   = []
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
protonbot-0.3.7 lib/protonbot/hook.rb
protonbot-0.3.6 lib/protonbot/hook.rb
protonbot-0.3.5 lib/protonbot/hook.rb
protonbot-0.3.4 lib/protonbot/hook.rb
protonbot-0.3.3 lib/protonbot/hook.rb
protonbot-0.3.2 lib/protonbot/hook.rb
protonbot-0.3.1 lib/protonbot/hook.rb
protonbot-0.3.0 lib/protonbot/hook.rb
protonbot-0.2.7 lib/protonbot/hook.rb
protonbot-0.2.6 lib/protonbot/hook.rb
protonbot-0.2.5 lib/protonbot/hook.rb
protonbot-0.2.4 lib/protonbot/hook.rb
protonbot-0.2.3 lib/protonbot/hook.rb
protonbot-0.2.2 lib/protonbot/hook.rb
protonbot-0.2.1 lib/protonbot/hook.rb
protonbot-0.2.0 lib/protonbot/hook.rb
protonbot-0.1.3 lib/protonbot/hook.rb
protonbot-0.1.2 lib/protonbot/hook.rb
protonbot-0.1.1 lib/protonbot/hook.rb
protonbot-0.1.0 lib/protonbot/hook.rb