class RubyMarks::Watcher

Attributes

name[R]
recognizer[R]

Public Class Methods

new(name, recognizer, &block) click to toggle source
# File lib/ruby_marks/watcher.rb, line 6
def initialize(name, recognizer, &block)
  raise ArgumentError, "Invalid watcher name" unless RubyMarks::AVAILABLE_WATCHERS.include?(name)
  @name = name
  @recognizer = recognizer
  @action = block
end

Public Instance Methods

run(*args) click to toggle source
# File lib/ruby_marks/watcher.rb, line 13
def run(*args)
  @action.call(@recognizer, *args) if @action
end